17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 16076 Views |
-
Re: Problem with i18n translation for included .ss files

29 April 2008 at 9:49pm
Ah - when you add these (in the cms/lang/en_US.php and the other languages):
$lang['en_US']['PageCommentInterface.ss']['PBY'] = 'Posted by';
$lang['en_US']['PageCommentInterface.ss']['APPROVE'] = 'approve this comment';
$lang['en_US']['PageCommentInterface.ss']['ISSPAM'] = 'this comment is spam';
$lang['en_US']['PageCommentInterface.ss']['ISNTSPAM'] = 'this comment is not spam';
$lang['en_US']['PageCommentInterface.ss']['REMCOM'] = 'remove this comment';it will work! Thank you for helping me!!! Great! I tried it before in different ways with no result but that's it! I guess the i18n translation is al little bit shaky because you have to find the included files. And sometimes there are strange effects in the results.....
Cheers,
tiga -
Re: Problem with i18n translation for included .ss files

30 April 2008 at 5:57am
Glad I could help. And even better to hear that it works
-
Re: Problem with i18n translation for included .ss files

30 August 2008 at 11:11pm Last edited: 30 August 2008 11:30pm
Generally, I don't get the point why it makes sense to have such a "deep" tree structure in the LOCALE stuff:
$lang['en_US']['PageCommentInterface_singlecomment.ss']['REMCOM'] = "...";
Why not just $lang['en_US']['REMCOM'] = "..."; ?
There should be at least something like
$lang['en_US']['default']['REMCOM'] = "...";This way, one *could* still define different names for different classes *optionally*. At this moment it seems like we had to re-define the comment (and probably some more) translations for the different classes, which is a not-so-nice redundancy.
By the way, does anybody know how to place edited translation files from /cms/lang/xx_XX.php into a project-specific directory, so that silverstripe can be upgraded without overwriting them?
-
Re: Problem with i18n translation for included .ss files

9 September 2008 at 12:01pm Last edited: 9 September 2008 12:18pm
ÿþÿрþñуùтõ тðú: ))
edit SSViewer.php. replace thison thispublic static function getTemplateContent($identifier) {
return file_get_contents(SSViewer::getTemplateFile($identifier));
}public static function getTemplateContent($identifier) {
$content = file_get_contents(SSViewer::getTemplateFile($identifier));
$content = ereg_replace('<' . '% +_t\((\'([^\']*)\'|"([^"]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '<?= _t(\''. $identifier . '.ss.\\2\\3\'\\4) ?>', $content);
$content = ereg_replace('<' . '% +sprintf\(_t\((\'([^\']*)\'|"([^"]*)")(([^)]|\)[^ ]|\) +[^% ])*)\),\<\?= +([^\?]*) +\?\>) +%' . '>', '<?= sprintf(_t(\''. $identifier . '.ss.\\2\\3\'\\4),\\6) ?>', $content);
return $content;
}
| 16076 Views | ||
| Go to Top |



