mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fallback for i18n::get_script_direction()
This commit is contained in:
parent
653d7bc1b7
commit
814c0c4055
@ -2479,7 +2479,11 @@ class i18n extends Object implements TemplateGlobalProvider {
|
||||
public static function get_script_direction($locale = null) {
|
||||
require_once 'Zend/Locale/Data.php';
|
||||
if(!$locale) $locale = i18n::get_locale();
|
||||
$dir = Zend_Locale_Data::getList($locale, 'layout');
|
||||
try {
|
||||
$dir = Zend_Locale_Data::getList($locale, 'layout');
|
||||
} catch(Zend_Locale_Exception $e) {
|
||||
$dir = Zend_Locale_Data::getList(i18n::get_lang_from_locale($locale), 'layout');
|
||||
}
|
||||
|
||||
return ($dir && $dir['characters'] == 'right-to-left') ? 'rtl' : 'ltr';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user