You are here

public function LocaleStringTest::createAllTranslations in Zircon Profile 8

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

Creates translations for source string and all languages.

2 calls to LocaleStringTest::createAllTranslations()
LocaleStringTest::testStringCRUDAPI in core/modules/locale/src/Tests/LocaleStringTest.php
Test CRUD API.
LocaleStringTest::testStringSearchAPI in core/modules/locale/src/Tests/LocaleStringTest.php
Test Search API loading multiple objects.

File

core/modules/locale/src/Tests/LocaleStringTest.php, line 189
Contains \Drupal\locale\Tests\LocaleStringTest.

Class

LocaleStringTest
Tests the locale string storage, string objects and data API.

Namespace

Drupal\locale\Tests

Code

public function createAllTranslations($source, $values = array()) {
  $list = array();

  /* @var $language_manager \Drupal\Core\Language\LanguageManagerInterface */
  $language_manager = $this->container
    ->get('language_manager');
  foreach ($language_manager
    ->getLanguages() as $language) {
    $list[$language
      ->getId()] = $this
      ->createTranslation($source, $language
      ->getId(), $values);
  }
  return $list;
}