By profix898 on
Is there any API function to get the active/selected language in Drupal 6? There are different ways to negotiate the language in D6 (e.g. url prefix, $user->language, fallback language, ...), but how can I get the active language in a module? Checking $user->language is apparently not sufficient because one can override this with a url prefix (e.g. language switcher block). I couldnt find an API call like i18n_get_lang() (from i18n module) in Drupal 6.
Comments
I finally found it myself.
I finally found it myself. There is no function but a global variable $language, which contains every information about the language of the current page request (see http://drupal.org/node/114774#language).
I couldn't put it to work in drupal 6
hi
Thanks
I wanted to get active language for deciding what calendar system(like Hiriji or global calendar) to show
I used $language but it's null in my calendar file;
can any body help me?
Make sure to use the global one.
Did you make sure you selected the global one and not created a local copy?