Skip to content

Commit b1b2365

Browse files
committed
Should fix bug reported in tests/main/inc/lib/internationalization.lib.test.php line 1284
1 parent b12288d commit b1b2365

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

main/inc/lib/internationalization.lib.php

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,23 +393,35 @@ function api_get_platform_isocodes() {
393393
*/
394394
function api_get_text_direction($language = null) {
395395
static $text_direction = array();
396-
397-
$language_is_supported = api_is_language_supported($language);
396+
397+
/*
398+
* Not necessary to validate the language because the list if rtl/ltr is harcoded
399+
*
400+
/*
401+
$language_is_supported = api_is_language_supported($language);
398402
if (!$language_is_supported || empty($language)) {
399403
$language = api_get_interface_language(false, true);
400-
}
401-
404+
}*/
405+
if (empty($language)) {
406+
$language = api_get_interface_language();
407+
}
402408
if (!isset($text_direction[$language])) {
403409
$text_direction[$language] = in_array(api_purify_language_id($language),
404410
array(
405-
'arabic', 'ar',
406-
'dari', 'prs',
407-
'hebrew', 'he',
411+
'arabic',
412+
'ar',
413+
'dari',
414+
'prs',
415+
'hebrew',
416+
'he',
408417
'iw',
409-
'pashto', 'ps',
410-
'persian', 'fa',
418+
'pashto',
419+
'ps',
420+
'persian',
421+
'fa',
411422
'ur',
412-
'yiddish', 'yid'
423+
'yiddish',
424+
'yid'
413425
)
414426
) ? 'rtl' : 'ltr';
415427
}

0 commit comments

Comments
 (0)