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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Language file adaptations


Go to End


3 Posts   1586 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

21 May 2009 at 10:41pm

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
anselmdk

Community Member, 18 Posts

26 August 2009 at 9:12pm

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

Community Member, 288 Posts

15 October 2009 at 1:53am

Edited: 15/10/2009 1:58am

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.