You are here

function Drupali18nTestCase::i18nAssertTranslations in Internationalization 7

Check strings for different languages

1 call to Drupali18nTestCase::i18nAssertTranslations()
i18nBlocksTestCase::testBlockTranslation in i18n_block/i18n_block.test

File

./i18n.test, line 226
Base class for Internationalization tests

Class

Drupali18nTestCase
@file Base class for Internationalization tests

Code

function i18nAssertTranslations($translations, $path = '', $message = 'Translation found for language.') {
  foreach ($translations as $langcode => $text) {
    $language = $this
      ->getLanguage($langcode);
    if ($language->enabled) {
      $this
        ->i18nGet($language, $path);
      $this
        ->assertRaw($text, $message . ' ' . $language->name . ': ' . check_plain($text));
    }
  }
}