You are here

protected function LocaleUpdateBase::setTranslationsDirectory in Drupal 9

Same name and namespace in other branches
  1. 8 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.

1 call to LocaleUpdateBase::setTranslationsDirectory()
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 79

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();
}