function ViewsUITourTest::createTranslation

Creates single translation for source string.

File

core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php, line 112

Class

ViewsUITourTest
Tests the Views UI tour.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function createTranslation($source, $langcode) {
  return $this->localeStorage
    ->createTranslation([
    'lid' => $source->lid,
    'language' => $langcode,
    'translation' => $this->randomMachineName(100),
  ])
    ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.