21290 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2168 Views |
-
Textcollector for module themes doesn´t work

5 August 2009 at 10:58pm Last edited: 5 August 2009 10:59pm
Hi,
when i run the textcollector by "$link/dev/tasks/i18nTextCollectorTask?module=themes" then it just says "Running task 'i18n Textcollector Task'..." and nothing happens, no subdirectory "lang" is created under /themes;
i just added the following line to the page.ss template under /themes/themename/templates/, so the textcollector should find it;<% _t('GoToEnglishTranslation','Go to the english translation') %>
further when i run the textcollector for all modules with $link/dev/tasks/i18nTextCollectorTask then i get an error that it needs phpunit, which is also described in ticket 4113, so this just works with installed phpunit for 2.3.3, but this would be no problem if i could run the textcollector just for the themes module;
help is very welcome,
Regards,
Alex -
Re: Textcollector for module themes doesn´t work

6 August 2009 at 9:59pm
Hi,
same problem here. Just tried it like AlexBeka with the same result. Also i can´t install PHPUnit, because i´m on a shared hosting server.Anyone who got that running already?
Best regards,
Otto -
Re: Textcollector for module themes doesn´t work

14 August 2009 at 9:05am
Disclaimer: I'm using SilverStripe for cca 2 days, so sorry if anything I wrote is wrong
1) themes is not a module, but just an ordinary directory (it does not have _config.php for example), so ?module=themes is meaningless
2) translations of templates must go to mysite/lang, so it's absolutely OK, that it does not create themes/lang
3) if you are brave you can try my patch to textcollector:
a) please backup you whole site
, especially the mysite/lang content as it will be overwritten
b) put$entitiesArr = array();
$fileList = $this->getFilesRecursive("$this->basePath/themes/gu");
foreach($fileList as $index => $filePath) {
Debug::message($filePath, false);
$content = file_get_contents($filePath);
// templates use their filename as a namespace
$namespace = basename($filePath);
$entitiesArr = array_merge($entitiesArr, (array)$this->collectFromTemplate($content, $module, $namespace));
}
$entitiesByModule['mysite'] = $entitiesArr;
to the sapphire/core/i18nTextCollector.php before the line:$this->writeMasterStringFile($entitiesByModule);
c) replace gu on the second line of the patch with name of your theme
d) run dev/tasks/i18nTextCollectorTask/?module=x (note: the x is just any nonexistent module name, so it won't process any real modules, so it will run much faster)
e) it should display processed files
f) in the mysite/lang/en_US.php should appear new translationsI do not guarantee anything (see disclaimer above).
-
Re: Textcollector for module themes doesn´t work

14 August 2009 at 9:36am
BTW the much easier solution is to use LangBuilder.
| 2168 Views | ||
|
Page:
1
|
Go to Top |


