Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Language file adaptations


Reply

3 Posts   1162 Views

Avatar
martimiz

21 May 2009 at 10:41pm Forum Moderator, 1095 Posts

Hi all,
What would I do if I wanted to change some of the existing translations in an official language file? I could alter the official file, but then I'd have to repeat that on every Silverstripe update. In this case I'm referring to the ModelAdmin translation, that resides in the cms/lang/xx_XX.php file. I guess any addition still needs to be somewhere in the cms namespace where ModelAdmin lives - but is there a way around this that would preserve my addition on update?

Avatar
anselm.dk

26 August 2009 at 9:12pm Community Member, 18 Posts

I've been fighting with the exact same problem yesterday, as there seems to be an error in a danish translation.
If you log in with a wrong password you get the following:

$lang['da_DK']['Member']['ERRORWRONGCRED'] = 'Link til at nulstille kodeordet er sendt til \'%s\'';

Which makes no sense. A more correct translation would be the follwing:

$lang['da_DK']['Member']['ERRORWRONGCRED'] = array('Brugernavn og kodeord stemmer ikke overens. Prøv igen.',PR_HIGH);

Btw. I tried to give it a PR_HIGH in my hope that it would be rendered before the actual file. But no luck.
For now I'll just have to replace the locale file in the sappire folder, but if anyone knows a way around this, it would be deeply appreciated!

Avatar
MarcusDalgren

15 October 2009 at 1:53am (Last edited: 15 October 2009 1:58am), Community Member, 288 Posts

Bumping this since I have the exact same issue.

I have tried creating a lang-folder in mysite and that works for stuff that hasn't been translated yet but the files in Sapphire and CMS override my own language file.

This should be changed so that any language file placed in mysite/lang will override any other language file so that we can use the language files from all the modules and the CMS but tweak/change the translations for the parts we want.

Having to edit the language files in Sapphire and CMS does not feel like a very good idea in the long run.

EDIT
Ok so I messed up. The solution I'm using actually works. Make a lang folder in mysite and put the appropriate php-file in there.
Whatever you put in that file will override the original translation.

I'm using this to retranslate the parts I don't agree with and to add translations to fix the nesting bug.