BUGFIX: Fixed inconsistencies in en vs. en_US handling in i18n

This commit is contained in:
Sam Minnee 2012-05-28 14:10:58 +12:00
parent 1709a1dd6b
commit db79739023
2 changed files with 5 additions and 2 deletions

View File

@ -1613,6 +1613,7 @@ class i18n extends Object implements TemplateGlobalProvider {
krsort(self::$translators);
i18n::include_by_locale('en_US');
i18n::include_by_locale('en');
}
/**

View File

@ -492,7 +492,7 @@ class i18nTest extends SapphireTest {
'AdapterEntity1 CustomAdapter (en_US)',
'New entities only defined in new adapter are detected'
);
// Add a second new translator to test priorities
$translator = new Zend_Translate(array(
'adapter' => 'i18nTest_OtherCustomTranslatorAdapter',
@ -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'
);