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.

Archive /

Our old forums are still available as a read-only archive.

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

Default language for single-language sites

Go to End

3 Posts   2163 Views


Community Member, 17 Posts

31 May 2008 at 6:06am

I'm working on a single-language site where the language is Polish.

The proposed "i18n::set_default_lang('pl');" or "i18n::set_default_lang('pl_PL');" added to _config.php has no effect on the site, it only affects the Translatable class. There is however the i18n::$default_locale member variable that seems to be used no matter what I call i18n::set_default_lang() with.

Presently I have changed i18n::$default_locale to pl_PL and the site works as expected (e.g. with Polish validation messages in forms) but this clearly is not the proper way of doing this.

Is this a bug? If so, should I file a bug report somewhere? Maybe i18n::set_default_lang function should be patched to set the i18n::$default_locale variable in addition to what it does?

On a side-note: I really like silverstripe's approach to building CMS sites, it's a bit rough around the edges, but generally a very nice system :)


Forum Moderator, 801 Posts

6 June 2008 at 9:14am

its a known inconsistency that dealing with locales vs. languages is a bit messy at the moment - we've got an offer from the mailinglist to help cleaning this up. i18n was a (time intensive) GSOC contribution, without this additional manpower we can't implement too much new stuff unfortunately. depending on your skill-level, you can have a stab at it yourself if you like (please contact me for more details)


Community Member, 17 Posts

6 June 2008 at 9:33am

The first thing is that I see that after upgrade'ing to 2.2.2 things have changed :)
I'm still unable to configure this properly but in a different way.

What I need for the site I'm currently working is to have localised form validation messages.
This requires three things, as far as I can see:
1. Setting correct language for the site to obtain properly localised messages.
2. Fixing field labels in server-side validation (see, I have also sent patches).
3. Internationalisation of sapphire/javascript/Validation.js or turning off javascript validation alltogether.

I have done 2 and I think I know how to achieve 3 and haven't looked into 1.

For this site I also need to be able to set form tab titles. Currently I have a simple workaround - proper fix might be related to i18n or not, that's why I mention it.

I will solve these issues either with messy hacks :) or proper fixes that I would contribute back to the project. Unfortunately I don't have much time to work on these issues in a broader spectrum.

In short, yes, any details will be welcome. You may contact me by e-mail or please direct me to a developer forum/mailing list or some other means of communication.