mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Fixed inconsistencies in en vs. en_US handling in i18n
This commit is contained in:
parent
1709a1dd6b
commit
db79739023
@ -1613,6 +1613,7 @@ class i18n extends Object implements TemplateGlobalProvider {
|
||||
krsort(self::$translators);
|
||||
|
||||
i18n::include_by_locale('en_US');
|
||||
i18n::include_by_locale('en');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -510,10 +510,12 @@ class i18nTest extends SapphireTest {
|
||||
'adapter' => 'i18nTest_OtherCustomTranslatorAdapter',
|
||||
'disableNotices' => true,
|
||||
));
|
||||
|
||||
i18n::register_translator($translator, 'othercustom_higher_prio', 15);
|
||||
|
||||
$this->assertEquals(
|
||||
i18n::_t('i18nTestModule.ENTITY'),
|
||||
'i18nTestModule.ENTITY OtherCustomAdapter (en_US)',
|
||||
'i18nTestModule.ENTITY OtherCustomAdapter (en)',
|
||||
'Adapter with higher priority wins'
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user