How to tell if the current language is written RTL or LTR I'm looking for the function &ndash; if that exists &ndash; for asking Drupal about the current language direction (RTL/LTR).

I check the global language variable but it doesn't contain that information.
After looking more closely into $GLOBALS['language'] I found it actually has the language direction, so the answer is:

global $language;
if($language-&gt;direction == 1)
    echo 'RTL';
else /* $language-&gt;direction == 0 */
    echo 'LTR';


Better yet &mdash; thank you MPD, I can use the Drupal constants LANGUAGE_LTR and LANGUAGE_RTL instead of 0 and 1 respectively, just like this: 

global $language;
if($language-&gt;direction == LANGUAGE_RTL)
    echo 'RTL';
else /* $language-&gt;direction == LANGUAGE_LTR */
    echo 'LTR';


For reference this is what $GLOBALS['language'] looks like:

stdClass Object
(
    [language] =&gt; ar
    [name] =&gt; Arabic
    [native] =&gt; 'Arabic' [it was in arabic letters but SE refused it]
    [direction] =&gt; 1
    [enabled] =&gt; 1
    [plurals] =&gt; 0
    [formula] =&gt; 
    [domain] =&gt; 
    [prefix] =&gt; ar
    [weight] =&gt; 0
    [javascript] =&gt; 
    [provider] =&gt; language-default
)