You are here

function xmlsitemap_language_load in XML sitemap 7.2

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_language_load()
  2. 6.2 xmlsitemap.module \xmlsitemap_language_load()
  3. 2.x xmlsitemap.module \xmlsitemap_language_load()

Load a language object by its language code.

@todo Remove when https://www.drupal.org/node/660736 is fixed in Drupal core.

Parameters

string $language: A language code. If not provided the default language will be returned.

Return value

object A language object.

4 calls to xmlsitemap_language_load()
XMLSitemapTestHelper::assertNoRawSitemapLinks in ./xmlsitemap.test
Assert No Raw Sitemap Links.
XMLSitemapTestHelper::assertRawSitemapLinks in ./xmlsitemap.test
Assert Raw Sitemap Links.
xmlsitemap_generate_chunk in ./xmlsitemap.generate.inc
Generate chunk.
xmlsitemap_i18n_xmlsitemap_context_url_options in xmlsitemap_i18n/xmlsitemap_i18n.module
Implements xmlsitemap_context_url_options().

File

./xmlsitemap.module, line 1557
xmlsitemap XML sitemap

Code

function xmlsitemap_language_load($language = LANGUAGE_NONE) {
  $languages =& drupal_static(__FUNCTION__);
  if (!isset($languages)) {
    $languages = language_list();
    $languages[LANGUAGE_NONE] = NULL;
  }
  return isset($languages[$language]) ? $languages[$language] : NULL;
}