You are here

public function LocaleImportFunctionalTest::testCreatedLanguageTranslation in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocaleImportFunctionalTest.php \Drupal\locale\Tests\LocaleImportFunctionalTest::testCreatedLanguageTranslation()

Test the translation are imported when a new language is created.

File

core/modules/locale/src/Tests/LocaleImportFunctionalTest.php, line 359
Contains \Drupal\locale\Tests\LocaleImportFunctionalTest.

Class

LocaleImportFunctionalTest
Tests the import of locale files.

Namespace

Drupal\locale\Tests

Code

public function testCreatedLanguageTranslation() {

  // Import a .po file to add de language.
  $this
    ->importPoFile($this
    ->getPoFileWithConfigDe(), array(
    'langcode' => 'de',
  ));

  // Get the language.entity.de label and check it's been translated.
  $override = \Drupal::languageManager()
    ->getLanguageConfigOverride('de', 'language.entity.de');
  $this
    ->assertEqual($override
    ->get('label'), 'Deutsch');
}