Fixing subsites not working with i18n in SilverStripe 3.1

Tries to access i18n::$likely_subtags directly. Config changes in
3.1 now prevent this from happening and fails.
i18n::get_locale_from_lang() is used instead to provide the locale.
This commit is contained in:
Sean Harvey 2013-04-30 15:15:11 +12:00
parent 397f74a561
commit 9658af5cc8

View File

@ -310,8 +310,9 @@ JS;
// Set locale
if (is_object($subsite) && $subsite->Language != '') {
if (isset(i18n::$likely_subtags[$subsite->Language])) {
i18n::set_locale(i18n::$likely_subtags[$subsite->Language]);
$locale = i18n::get_locale_from_lang($subsite->Language);
if($locale) {
i18n::set_locale($locale);
}
}