function locale_install in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/locale/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);
}