mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
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:
parent
397f74a561
commit
9658af5cc8
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user