You are here

public function LocaleImportFunctionalTest::testConfigtranslationImportingPoFile 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::testConfigtranslationImportingPoFile()

Tests .po file import with user.settings configuration.

File

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

Class

LocaleImportFunctionalTest
Tests the import of locale files.

Namespace

Drupal\locale\Tests

Code

public function testConfigtranslationImportingPoFile() {

  // Set the language code.
  $langcode = 'de';

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

  // Check that the 'Anonymous' string is translated.
  $config = \Drupal::languageManager()
    ->getLanguageConfigOverride($langcode, 'user.settings');
  $this
    ->assertEqual($config
    ->get('anonymous'), 'Anonymous German');
}