function InstallerLanguageTrait::installParameters

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/Traits/Core/Locale/InstallerLanguageTrait.php \Drupal\Tests\Traits\Core\Locale\InstallerLanguageTrait::installParameters()

File

core/tests/Drupal/Tests/Traits/Core/Locale/InstallerLanguageTrait.php, line 40

Class

InstallerLanguageTrait
A trait to install Drupal in a specific language.

Namespace

Drupal\Tests\Traits\Core\Locale

Code

protected function installParameters() : array {
  $parameters = parent::installParameters();
  $parameters['parameters']['langcode'] = $this->getInstallLangcode();
  // Create a po file so we don't attempt to download one from
  // localize.drupal.org and to have a test translation that will not change.
  \Drupal::service('file_system')->mkdir($this->publicFilesDirectory . '/translations', NULL, TRUE);
  file_put_contents($this->publicFilesDirectory . '/translations/drupal-' . \Drupal::VERSION . '.' . $this->getInstallLangcode() . '.po', $this->getTranslationFileContents());
  return $parameters;
}

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