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

Standard login form in another language.


Go to End


3 Posts   856 Views

Avatar
Josua

Community Member, 87 Posts

29 February 2012 at 9:33am

Edited: 01/03/2012 1:12am

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.

Avatar
novaweb

Community Member, 116 Posts

2 March 2012 at 2:45pm

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

Avatar
Josua

Community Member, 87 Posts

4 March 2012 at 7:29am

Edited: 04/03/2012 7:32am

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