You are here

function Drupali18nTestCase::addLanguage in Internationalization 6

Same name and namespace in other branches
  1. 7 i18n.test \Drupali18nTestCase::addLanguage()

Adds a language

Parameters

$langcode:

$default: Whether this is the default language

$load: Whether to load available translations for that language

5 calls to Drupali18nTestCase::addLanguage()
Drupali18nTestCase::setUp in tests/drupal_i18n_test_case.php
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
i18n_API_Tests::setUp in tests/i18n_api.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
i18n_Blocks_Test::setUp in tests/i18n_blocks.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
i18n_Strings_Test::setUp in tests/i18n_strings.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
i18n_Taxonomy_Test::setUp in tests/i18n_taxonomy.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

File

tests/drupal_i18n_test_case.php, line 29

Class

Drupali18nTestCase
Test case for typical Drupal tests.

Code

function addLanguage($langcode, $default = FALSE, $load = TRUE) {
  require_once './includes/locale.inc';

  // Enable installation language as default site language.
  locale_add_language($langcode, NULL, NULL, NULL, NULL, NULL, 1, $default);

  // Reset language list
  language_list('language', TRUE);

  // We may need to refresh default language
  drupal_init_language();

  // @todo import po files for this language
}