function locale_install

locale_install()

Implements hook_install().

File

core/modules/locale/locale.install, line 13
Install, update, and uninstall functions for the Locale module.

Code

function locale_install() {
  // Create the interface translations directory and ensure it's writable.
  if (!$directory = \Drupal::config('locale.settings')->get('translation.path')) {
    $site_path = \Drupal::service('site.path');
    $directory = $site_path . '/files/translations';
    \Drupal::configFactory()->getEditable('locale.settings')->set('translation.path', $directory)->save();
  }
  file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.install/function/locale_install/8.1.x