Migrated from http://open.silverstripe.org/ticket/7057
In the pages created automatically (Security/Login?, Security/Lostpassword? , Security/Passwordsent? , forummemberprofile/register, etc. ) The texts are not translated correctly although if I connect the appropriate locale.
This is a problem in SilverStripe? 2.4, but I guess it must be equally at SilverStripe? 3, besides is probably a kernel problem.
Example 1:
ScreenShot? SC001.png
_config.php
$cu_locale = 'en_US'; TranslatableEx::set_current_locale($cu_locale); i18n::set_default_locale($cu_locale); i18n::set_locale($cu_locale);
Page.php
public function init() {
parent::init(); $cu_locale = 'es_ES'; TranslatableEx::set_current_locale($cu_locale); i18n::set_default_locale($cu_locale); i18n::set_locale($cu_locale); ........
}
All text is displayed correctly in Spanish, no problem.
ScreenShot? SC002.png
_config.php
$cu_locale = 'en_US'; TranslatableEx::set_current_locale($cu_locale); i18n::set_default_locale($cu_locale); i18n::set_locale($cu_locale);
Page.php
public function init() {
parent::init(); $cu_locale = 'es_ES'; TranslatableEx::set_current_locale($cu_locale); i18n::set_default_locale($cu_locale); i18n::set_locale($cu_locale); ........
}
Login page: All text are displayed correctly in Spanish, except Site Tagline/Slogan? and the page title that are incorrectly displayed in English.
Example 3:
ScreenShot? SC003.png
_config.php
$cu_locale = 'es_ES'; TranslatableEx::set_current_locale($cu_locale); i18n::set_default_locale($cu_locale); i18n::set_locale($cu_locale);
Page.php
public function init() {
parent::init(); $cu_locale = 'es_ES'; TranslatableEx::set_current_locale($cu_locale); i18n::set_default_locale($cu_locale); i18n::set_locale($cu_locale); ........
}
Login page: All text are displayed correctly in Spanish, except Site Tagline/Slogan? that is incorrectly displayed in English.
As you can see, not enough to set the locale in the controller init function, you need to put it into _config.php, however, even putting it in both places, the text Site Tagline/Slogan? is shown incorrectly in English.
In addition to this problem, $_SESSION cannot use to propagate the locale between the pages, since in _config.php not yet exists.
Regards, Jose
http://open.silverstripe.org/attachment/ticket/7057/SC001.png
http://open.silverstripe.org/attachment/ticket/7057/SC002.png
http://open.silverstripe.org/attachment/ticket/7057/SC003.png