Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » how can i set language for single language site?

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

Page: 1
Go to End
Author Topic: 2196 Views
  • helix76
    Avatar
    Community Member
    1 Post

    how can i set language for single language site? Link to this post

    Hello,

    all other answers in the forum didn't work out, so i'll post a new topic.

    What I've already done:
    1.) I set up a silverstripe yesterday and i can't set the frontend language to germany.
    (the backend works in german language, because i set up 'german' in the profile area)

    2.) I added a line

    i18n::set_locale('de_DE');

    to the _config.php in /mysite/

    take a look here:
    http://bolle.pc-xperte.de/g-stebuch/

    the problem is:
    A part of the site shows up in german (for example 'Geben Sie einen Kommentar ab' in german instead of 'Give your comment' in english), but all other parts are still english, for example 'your comment' and 'posted by', also 'go to ...' instead of the german 'gehe zu' when you click on a button.

    The right translations are inside the de_DE.php file, so this doesn't seem to be the problem.

    what can i do? Thanks for your help.

  • WalterW
    Avatar
    Community Member
    17 Posts

    Re: how can i set language for single language site? Link to this post

    I have the same problem with 2.3.1
    I use in mysite/_config.php

    i18n::enable();
    i18n::set_locale('de_DE');
    i18n::set_default_lang('de');
    setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');

    and e.g. the "Search" is still a "Search" and not a "Suche".

    I debugged the i18n and changed already the line from en_US to de_DE.
    Now it is:
       protected static $default_locale = 'de_DE';

    but no change e.g. in the search form!

    What can be wrong?

    2196 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.