function LocaleUpdateBase::setTranslationsDirectory

Same name in other branches
  1. 9 core/modules/locale/tests/src/Functional/LocaleUpdateBase.php \Drupal\Tests\locale\Functional\LocaleUpdateBase::setTranslationsDirectory()
  2. 8.9.x core/modules/locale/tests/src/Functional/LocaleUpdateBase.php \Drupal\Tests\locale\Functional\LocaleUpdateBase::setTranslationsDirectory()
  3. 10 core/modules/locale/tests/src/Functional/LocaleUpdateBase.php \Drupal\Tests\locale\Functional\LocaleUpdateBase::setTranslationsDirectory()

Sets the value of the default translations directory.

Parameters

string $path: Path of the translations directory relative to the drupal installation directory.

2 calls to LocaleUpdateBase::setTranslationsDirectory()
LocaleTranslationChangeProjectVersionTest::setUp in core/modules/locale/tests/src/Functional/LocaleTranslationChangeProjectVersionTest.php
LocaleUpdateBase::setTranslationFiles in core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
Setup the environment containing local and remote translation files.

File

core/modules/locale/tests/src/Functional/LocaleUpdateBase.php, line 80

Class

LocaleUpdateBase
Base class for testing updates to string translations.

Namespace

Drupal\Tests\locale\Functional

Code

protected function setTranslationsDirectory($path) {
    \Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY);
    $this->config('locale.settings')
        ->set('translation.path', $path)
        ->save();
}

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