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.

Customising the CMS /

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

how can i set language for single language site?


Go to End


2 Posts   3176 Views

Avatar
helix76

Community Member, 1 Post

17 January 2009 at 8:31pm

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.

Avatar
WalterW

Community Member, 18 Posts

8 April 2009 at 12:44am

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?