Jump to:

23363 Posts in 18124 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Language file adaptations

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

Page: 1
Go to End
Author Topic: 1125 Views
  • martimiz
    Avatar
    Forum Moderator
    1067 Posts

    Language file adaptations Link to this post

    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?

  • anselm.dk
    Avatar
    Community Member
    18 Posts

    Re: Language file adaptations Link to this post

    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!

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: Language file adaptations Link to this post

    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.

    1125 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.