From: Diogo Cordeiro Date: Tue, 14 May 2019 14:51:42 +0000 (+0100) Subject: is_rtl should handle lang instead of code X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d9a42550ff5653082c9d06aa9a48963599688bf4;p=quix0rs-gnu-social.git is_rtl should handle lang instead of code --- diff --git a/lib/language.php b/lib/language.php index 8ed4021401..f0144b4106 100644 --- a/lib/language.php +++ b/lib/language.php @@ -294,11 +294,13 @@ function get_nice_language_list() * @return boolean true if language is rtl */ -function is_rtl($lang) +function is_rtl($lang_value) { - $all_languages = common_config('site', 'languages'); - $lang = $all_languages[$lang]; - return ($lang['direction'] == 'rtl'); + foreach (common_config('site', 'languages') as $code => $info) { + if ($lang_value == $info['lang']) { + return $info['direction'] == 'rtl'; + } + } } /**