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

setting frontend language


Go to End


4 Posts   2050 Views

Avatar
hwi

Community Member, 5 Posts

1 February 2010 at 12:14pm

Hi
I guess it should be a simple task - but I jut not get it ...
How to set your frontend language to another than english - I can see the files are there.

I red forth and back on the
// Enable Translations
i18n::enable();
i18n::set_locale('da_DK');
i18n::set_default_lang('da_DK');
added that in the mysite/_config.php
and flushed site
and dev/build

But I do not get it - is the above really the way to go about making:
lets say the "search button" or the hover tooltip "go to ...... page"
change to your language?

Please some one show me step by step what to do...

Thanks in advance

PS to the dev:
Why is the demo site of Silverstripe show a dropdown language list in admin - when a fresh install do not seem to have it?
Is there something wrong in my server environment?

I red a few hours on translations , multi language and so on - I find the documentation to be very difficult to oversee and several comments beneath stating that there is code errors in the tutorials...

Setting the language of the frontend should be a straight forward thing to do - preferable from admin - with not a single touch to files, same goes for the way of assigning templates

Anyway:
Your CMS looks great! - Thanks for sharing

Avatar
Juanitou

Community Member, 323 Posts

1 February 2010 at 11:00pm

Hi hwi!

I’ve never used i18n without enabling Translatable, so my advice is maybe wrong, but I think i18n::set_default_lang() won’t work because it’s the same thing as Translatable::set_default_lang(). Normally you could remove it. Have you tried echoing i18n::get_locale() for testing if da_DK is being used?

As for the dropdown language list in admin, it’s Translatable which enables it.

Avatar
hwi

Community Member, 5 Posts

2 February 2010 at 1:03am

Hi Juanitou

Thanks for the input - I will try to get the Translatable going. I might have misunderstood that this have to be done first.

Thanks for you reply
Cheers

Avatar
carlos

Community Member, 42 Posts

5 February 2010 at 3:45pm

Hi,

you are right, you can set language in mysite > _config.php i18n::set_locale('es_ES');

Now, the search form values are not translatable, so you will have to do it manually, SearchForm() in Page.php