is_rtl should handle lang instead of code

This commit is contained in:
Diogo Cordeiro 2019-05-14 15:51:42 +01:00
parent ceae66a30f
commit d9a42550ff

View File

@ -294,11 +294,13 @@ function get_nice_language_list()
* @return boolean true if language is rtl * @return boolean true if language is rtl
*/ */
function is_rtl($lang) function is_rtl($lang_value)
{ {
$all_languages = common_config('site', 'languages'); foreach (common_config('site', 'languages') as $code => $info) {
$lang = $all_languages[$lang]; if ($lang_value == $info['lang']) {
return ($lang['direction'] == 'rtl'); return $info['direction'] == 'rtl';
}
}
} }
/** /**