Jump to:

22976 Posts in 11667 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Multilingual page with secured pages

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 818 Views
  • pali
    Avatar
    Community Member
    33 Posts

    Multilingual page with secured pages Link to this post

    hello,

    i just created multilingual website (default language is slovak sk_SK, second language is english en_US). SS = 2.4.0

    my _config.php looks like this:

    Translatable::set_default_locale('sk_SK');
    Object::add_extension('SiteTree','Translatable');
    Object::add_extension('SiteConfig','Translatable');
    Translatable::set_allowed_locales(array('sk_SK','en_US'));

    and myste/Page.php -> controller's init() includes:

    if($this->dataRecord->hasExtension('Translatable')) {
             i18n::set_locale($this->dataRecord->Locale);
          }

    Everything works great except one thing - I have one secured page (created in slovak and translated to english) which looks like this if not logged in:

    Slovak language:
    Menu -> Slovak sitetree
    Note ($lang['xx_XX']['Security']['NOTEPAGESECURED']) -> is from english lang file (but is translated in Sapphire's Slovak lang file, should use this one)
    Fields (email, password, button) and lost password -> in Slovak

    English language: looks exactly same as slovak

    Probably its caused, because visitor is redirected to login page like this: DOMAIN/Security/login?BackURL=%2Fxyz%2F and Security doest check, which language is "xyz" ?

    Also, there is somthing wrong with "Note" whic is all the time in english. If i add in _config.php this:

    i18n::set_locale("sk_SK");


    i get correct Note (in Slovak).

    If i change it to i18n::set_locale("en_US") , Note is correctly in english, but for fields are in Slovak.

    Probably, Note depends on i18n, all other parts on translatable setup.

    Any hint?

    Regards

    pali

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