From b1b2365becf2dfecbe66beb30032eede8078eae5 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 25 Aug 2011 18:52:44 +0200 Subject: [PATCH] Should fix bug reported in tests/main/inc/lib/internationalization.lib.test.php line 1284 --- main/inc/lib/internationalization.lib.php | 32 ++++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/main/inc/lib/internationalization.lib.php b/main/inc/lib/internationalization.lib.php index 0732ccc3be..2422c74d1a 100755 --- a/main/inc/lib/internationalization.lib.php +++ b/main/inc/lib/internationalization.lib.php @@ -393,23 +393,35 @@ function api_get_platform_isocodes() { */ function api_get_text_direction($language = null) { 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)) { $language = api_get_interface_language(false, true); - } - + }*/ + if (empty($language)) { + $language = api_get_interface_language(); + } if (!isset($text_direction[$language])) { $text_direction[$language] = in_array(api_purify_language_id($language), array( - 'arabic', 'ar', - 'dari', 'prs', - 'hebrew', 'he', + 'arabic', + 'ar', + 'dari', + 'prs', + 'hebrew', + 'he', 'iw', - 'pashto', 'ps', - 'persian', 'fa', + 'pashto', + 'ps', + 'persian', + 'fa', 'ur', - 'yiddish', 'yid' + 'yiddish', + 'yid' ) ) ? 'rtl' : 'ltr'; }