Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Default language for single-language sites

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

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

Page: 1
Go to End
Author Topic: 1923 Views
  • cinek
    Community Member
    17 Posts

    Default language for single-language sites Link to this post

    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

  • Ingo
    Forum Moderator
    801 Posts

    Re: Default language for single-language sites Link to this post

    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)

  • cinek
    Community Member
    17 Posts

    Re: Default language for single-language sites Link to this post

    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 http://www.silverstripe.com/site-builders-forum/flat/80566, 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.

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.