LeKoala\Base\i18n\MultilingualTextCollector
Improved text collector
See https://github.com/silverstripe/silverstripe-framework/issues/7647
Synopsis
class MultilingualTextCollector
extends i18nTextCollector
{
- // members
- protected boolean $debug = false;
- protected boolean $clearUnused = false;
- protected array $restrictToModules = ;
- protected boolean $mergeWithExisting = true;
- protected boolean $preventWrite = false;
- protected boolean $autoTranslate = false;
- // methods
- public void __construct()
- public array run()
- public array collect()
- protected array mergeWithExisting()
- protected array getEntitiesByModule()
- public array collectFromTheme()
- public array collectFromTemplate()
- public string getThemeDir()
- public boolean isAdminTheme()
- public boolean getClearUnused()
- public $this setClearUnused()
- public array getRestrictToModules()
- public $this setRestrictToModules()
- public boolean getMergeWithExisting()
- public $this setMergeWithExisting()
- public boolean getDebug()
- public $this setDebug()
- public boolean getAutoTranslate()
- public $this setAutoTranslate()
Hierarchy
Extends
- SilverStripe\i18n\TextCollection\i18nTextCollector
Members
protected
- $autoTranslate — boolean
- $clearUnused — boolean
- $debug — boolean
- $mergeWithExisting — boolean
- $preventWrite — boolean
- $restrictToModules — array
Methods
protected
- getEntitiesByModule() — Collect all entities grouped by module
- mergeWithExisting() — Merge all entities with existing strings
public
- __construct()
- collect() — Extract all strings from modules and return these grouped by module name
- collectFromTemplate() — Extracts translatables from .ss templates (Self referencing)
- collectFromTheme()
- getAutoTranslate() — Get the value of autoTranslate
- getClearUnused() — Get the value of clearUnused
- getDebug() — Get the value of debug
- getMergeWithExisting() — Get the value of mergeWithExisting
- getRestrictToModules() — Get the value of restrictToModules
- getThemeDir() — Get current theme dir (regardless of current theme set) This will work in admin for instance
- isAdminTheme()
- run() — This is the main method to build the master string tables with the original strings. It will search for existent modules that use the i18n feature, parse the _t() calls and write the resultant files in the lang folder of each module.
- setAutoTranslate() — Set the value of autoTranslate
- setClearUnused() — Set the value of clearUnused
- setDebug() — Set the value of debug
- setMergeWithExisting() — Set the value of mergeWithExisting
- setRestrictToModules() — Set the value of restrictToModules