0

I have set a central translations directory(sites/all/translations) for my multisite installation profile so that each site does not have to download translations that were already downloaded.

I have set this via global settings file that I am including in the site's settings file, but it did not helped. Then I have added locale.settings.yml config into the profile, still no change. This works always AFTER the site was installed.

In the site installer there is a condition that checks if the config value for the directory exists in the global config variable, it will use that value or if not it will use the site's own translations directory by default.

So I think that during the installation process using config won't work and the only way is to use the global config variable.

So my question is how I can provide this variable to drush's site install command?

I am talking specifically about this: core/includes/install.core.inc:411

  // Register the file translation service.
  if (isset($GLOBALS['config']['locale.settings']['translation']['path'])) {
    $directory = $GLOBALS['config']['locale.settings']['translation']['path'];
  }
  else {
    $directory = $site_path . '/files/translations';
  }
  $container->set('string_translator.file_translation', new FileTranslation($directory));
  $container->get('string_translation')
    ->addTranslator($container->get('string_translator.file_translation'));
2
  • I don't get what you are asking. If you want to control that path, then put just put it in settings.php?
    – Berdir
    Jan 8, 2016 at 20:04
  • @Berdir drupal.org/node/2646560
    – user21641
    Jan 8, 2016 at 20:40

1 Answer 1

0

It is not possible to override this since the install_check_translations() has this hard-coded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.