mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
75ba6a1ab9
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77764 467b73ca-7a2a-4603-9d3b-597d59a354a9
34 lines
974 B
PHP
34 lines
974 B
PHP
<?php
|
|
/**
|
|
* @package sapphire
|
|
* @subpackage tasks
|
|
*/
|
|
class i18nTextCollectorTask extends BuildTask {
|
|
|
|
protected $title = "i18n Textcollector Task";
|
|
|
|
protected $description = "
|
|
Traverses through files in order to collect the 'entity master tables'
|
|
stored in each module.
|
|
";
|
|
|
|
function init() {
|
|
if(!Director::is_cli() && !Director::isDev() && !Permission::check("ADMIN")) Security::permissionFailure();
|
|
parent::init();
|
|
}
|
|
|
|
/**
|
|
* 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.
|
|
*
|
|
* @uses DataObject->collectI18nStatics()
|
|
*/
|
|
public function run($request) {
|
|
set_time_limit(0);
|
|
$c = new i18nTextCollector();
|
|
$restrictModules = ($request->getVar('module')) ? explode(',', $request->getVar('module')) : null;
|
|
return $c->run($restrictModules);
|
|
}
|
|
}
|
|
?>
|