dsaiztc
10/13/2016 - 1:58 PM

Determine whether or not a language directionality is RTL (right-to-left)

Determine whether or not a language directionality is RTL (right-to-left)

def is_rtl_language(language_code):
  """
  Args:
    language (str): ISO 639-1 (alpha2 / two letter) code. Example: "en"
  Returns:
    True if the language is written RTL (Right-to-left), False otherwise
  """
  return language_code in ['ar', 'dv', 'ha', 'he', 'ks', 'ku', 'ps', 'ur', 'yi']
function isRtlLanguage(language) {
    return !!~['ar', 'dv', 'ha', 'he', 'ks', 'ku', 'ps', 'ur', 'yi'].indexOf(language)
}