You are here

function _i18n_get_context_lang in Internationalization 6

Get language from context.

1 call to _i18n_get_context_lang()
i18ntaxonomy_taxonomy in i18ntaxonomy/i18ntaxonomy.module
Implementation of hook_taxonomy().

File

./i18n.module, line 728
Internationalization (i18n) module.

Code

function _i18n_get_context_lang() {

  // Node language when loading specific nodes or creating translations.
  if (arg(0) == 'node') {
    if (($node = menu_get_object('node')) && $node->language) {
      return $node->language;
    }
    elseif (arg(1) == 'add' && !empty($_GET['translation']) && !empty($_GET['language'])) {
      return $_GET['language'];
    }
  }
}