Function to test for RTL language
This commit is contained in:
parent
e8d45a4644
commit
8b9258c0ec
@ -289,6 +289,21 @@ function get_nice_language_list()
|
|||||||
return $nice_lang;
|
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
|
* Get a list of all languages that are enabled in the default config
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user