From 8b9258c0ec46f0c12fc4d8d1da73120a4ed62cbc Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 25 Aug 2011 12:48:36 -0700 Subject: [PATCH] Function to test for RTL language --- lib/language.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/language.php b/lib/language.php index 2af62fea0c..d72380e466 100644 --- a/lib/language.php +++ b/lib/language.php @@ -289,6 +289,21 @@ function get_nice_language_list() return $nice_lang; } +/* + * Check whether a language is right-to-left + * + * @param string $lang language code of the language to check + * + * @return boolean true if language is rtl + */ + +function is_rtl($lang) +{ + $all_languages = common_config('site', 'languages'); + $lang = $all_languages[$lang]; + return ($lang['direction'] == 'rtl'); +} + /** * Get a list of all languages that are enabled in the default config * -- 2.39.5