Jump to:

22976 Posts in 11702 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Standard login form in another language.

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: 394 Views
  • Josua
    Avatar
    Community Member
    86 Posts

    Standard login form in another language. Link to this post

    Hi!

    How can display standard login form in another language?

    I call it as follows: http://127.0.0.1/Security/login?locale=es_ES

    The texts are displayed in English.

    I saw that another useer had the same problem and no one gave him a solution:
    http://www.silverstripe.org/form-questions/show/18564

    Does not anyone have a solution to this problem?

    Thanks,

    Regards,
    Jose A.

  • novaweb
    Avatar
    Community Member
    109 Posts

    Re: Standard login form in another language. Link to this post

    Hola Jose,

    Are you trying to translate your whole website, or just the login page? Do you want the user to be able to choose from English or Spanish, or be forced to use Spanish?

    There are multiple ways to achieve this with varying levels of difficulty.

    Josh

  • Josua
    Avatar
    Community Member
    86 Posts

    Re: Standard login form in another language. Link to this post

    Hello Josh!

    I'm trying to translate my whole website.

    I would like that users could choose the language, but also detect the browser language to select, in a first moment, the web in that language automatically.

    The following not work correctly:
    public function init() {
       parent::init();

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

    If I put the following in _config.php:
    -----
    Translatable::set_default_locale('en_US');

    $cu_locale = "es_ES";
    i18n::set_default_locale($cu_locale);
    i18n::set_locale($cu_locale);
    Translatable::set_current_locale($cu_locale);
    -----
    then all pages are rendered correctly (even the login form), but this not work to do dynamic changes by the user, unless the cookies are used.

    I've also seen that the Translatable::choose_site_locale function could be used to these matters, but I think it is not possible to overload.

    I have also seen that some texts of the blog widgets are harcoded texts.
    It is strange that at this point have not been made appropiate changes to the blog module to fix these problems. Furthermore when it has been a long time since other people had said it.

    I really like SilverStripe and I know that it is a open source product, but there are some things that should be corrected more quickly. At least if they wish that SilverStripe comes to the same positions as other CMS's.

    I now am a beginner and would like to add my support in the future, but I also think that some things cannot keep without solving months and months, as I have seen when I have begun to study SilverStripe. And this should begin for the base, that's to say, for the SilverStripe company.

    I want these words are taken as something constructive.

    Thank you very much for your attention Josh!!

    Jose

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