You are here

public function Drupali18nTestCase::i18nstringsCreateTranslation in Internationalization 6

Create and store one translation into the db

2 calls to Drupali18nTestCase::i18nstringsCreateTranslation()
i18n_Blocks_Test::i18nTranslateBlock in tests/i18n_blocks.test
Translate block fields to all languages
i18n_Taxonomy_Test::testTaxonomyTranslationAPI in tests/i18n_taxonomy.test

File

tests/drupal_i18n_test_case.php, line 211

Class

Drupali18nTestCase
Test case for typical Drupal tests.

Code

public function i18nstringsCreateTranslation($name, $lang, $length = 20) {
  $translation = $this
    ->randomName($length, "i18n-{$lang}-");
  $count = self::i18nstringsSaveTranslation($name, $lang, $translation);
  $this
    ->assertTrue($count, "A translation({$lang}) has been created for string {$name}");
  return $translation;
}