You are here

function i18n_language_object in Internationalization 7

Get language object from language code or object.

Parameters

$language: Language code or language object to convert to valid language object.

Return value

Language object if this is an object or a valid language code.

10 calls to i18n_language_object()
i18nTaxonomyTestCase::testTaxonomyTermLocalize in i18n_taxonomy/i18n_taxonomy.test
i18nVariableTestCase::testVariableLocalize in i18n_variable/i18n_variable.test
i18n_field_page_translate in i18n_field/i18n_field.pages.inc
Field translation page
i18n_language in ./i18n.module
WARNING: Obsolete function, use other i18n_language_* instead.
i18n_node_i18n_context_language in i18n_node/i18n_node.module
Implements hook_i18n_context_language().

... See full list

File

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

Code

function i18n_language_object($language) {
  if (is_object($language)) {
    return $language;
  }
  else {
    $list = language_list();
    return isset($list[$language]) ? $list[$language] : NULL;
  }
}