function LocaleImportFunctionalTest::testLanguageContext

Test msgctxt context support.

File

drupal/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php, line 199
Definition of Drupal\locale\Tests\LocaleImportFunctionalTest.

Class

LocaleImportFunctionalTest
Functional tests for the import of translation files.

Namespace

Drupal\locale\Tests

Code

function testLanguageContext() {

  // Try importing a .po file.
  $this
    ->importPoFile($this
    ->getPoFileWithContext(), array(
    'langcode' => 'hr',
  ));
  $this
    ->assertIdentical(t('May', array(), array(
    'langcode' => 'hr',
    'context' => 'Long month name',
  )), 'Svibanj', t('Long month name context is working.'));
  $this
    ->assertIdentical(t('May', array(), array(
    'langcode' => 'hr',
  )), 'Svi.', t('Default context is working.'));
}