|
|
@ -393,23 +393,35 @@ function api_get_platform_isocodes() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function api_get_text_direction($language = null) { |
|
|
|
function api_get_text_direction($language = null) { |
|
|
|
static $text_direction = array(); |
|
|
|
static $text_direction = array(); |
|
|
|
|
|
|
|
|
|
|
|
$language_is_supported = api_is_language_supported($language); |
|
|
|
/* |
|
|
|
|
|
|
|
* Not necessary to validate the language because the list if rtl/ltr is harcoded |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
$language_is_supported = api_is_language_supported($language); |
|
|
|
if (!$language_is_supported || empty($language)) { |
|
|
|
if (!$language_is_supported || empty($language)) { |
|
|
|
$language = api_get_interface_language(false, true); |
|
|
|
$language = api_get_interface_language(false, true); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
if (empty($language)) { |
|
|
|
|
|
|
|
$language = api_get_interface_language(); |
|
|
|
|
|
|
|
} |
|
|
|
if (!isset($text_direction[$language])) { |
|
|
|
if (!isset($text_direction[$language])) { |
|
|
|
$text_direction[$language] = in_array(api_purify_language_id($language), |
|
|
|
$text_direction[$language] = in_array(api_purify_language_id($language), |
|
|
|
array( |
|
|
|
array( |
|
|
|
'arabic', 'ar', |
|
|
|
'arabic', |
|
|
|
'dari', 'prs', |
|
|
|
'ar', |
|
|
|
'hebrew', 'he', |
|
|
|
'dari', |
|
|
|
|
|
|
|
'prs', |
|
|
|
|
|
|
|
'hebrew', |
|
|
|
|
|
|
|
'he', |
|
|
|
'iw', |
|
|
|
'iw', |
|
|
|
'pashto', 'ps', |
|
|
|
'pashto', |
|
|
|
'persian', 'fa', |
|
|
|
'ps', |
|
|
|
|
|
|
|
'persian', |
|
|
|
|
|
|
|
'fa', |
|
|
|
'ur', |
|
|
|
'ur', |
|
|
|
'yiddish', 'yid' |
|
|
|
'yiddish', |
|
|
|
|
|
|
|
'yid' |
|
|
|
) |
|
|
|
) |
|
|
|
) ? 'rtl' : 'ltr'; |
|
|
|
) ? 'rtl' : 'ltr'; |
|
|
|
} |
|
|
|
} |
|
|
|