locale_js_settings_alter

locale_js_settings_alter(&$settings, AttachedAssetsInterface $assets) Implements hook_js_settings_alter(). Generates the values for the altered core/jquery.ui.datepicker library. File core/modules/locale/locale.module, line 612 Enables the translation of the user interface to languages other than English. Code function locale_js_settings_alter(&$settings, AttachedAssetsInterface $assets) { if (isset($settings['jquery']['ui']['datepicker'])) { $language_interface = \Drupal::langu

LOCALE_JS_OBJECT_CONTEXT

Regular expression to match an object containing a key 'context'. Pattern to match a JS object containing a 'context key' with a string value, which is captured. Will fail if there are nested objects. File core/modules/locale/locale.module, line 47 Enables the translation of the user interface to languages other than English. Code define('LOCALE_JS_OBJECT_CONTEXT', ' \{ # match object literal start .*? # match anything, non-greedy (?: # match a form

LOCALE_JS_OBJECT

Regular expression pattern used to match simple JS object literal. This pattern matches a basic JS object, but will fail on an object with nested objects. Used in JS file parsing for string arg processing. File core/modules/locale/locale.module, line 39 Enables the translation of the user interface to languages other than English. Code const LOCALE_JS_OBJECT = '\{.*?\}';

locale_js_alter

locale_js_alter(&$javascript, AttachedAssetsInterface $assets) Implements hook_js_alter(). File core/modules/locale/locale.module, line 487 Enables the translation of the user interface to languages other than English. Code function locale_js_alter(&$javascript, AttachedAssetsInterface $assets) { // @todo Remove this in https://www.drupal.org/node/2421323. $files = array(); foreach ($javascript as $item) { if (isset($item['type']) && $item['type'] == 'file') {

locale_is_translatable

locale_is_translatable($langcode) Checks whether $langcode is a language supported as a locale target. Parameters string $langcode: The language code. Return value bool Whether $langcode can be translated to in locale. File core/modules/locale/locale.module, line 743 Enables the translation of the user interface to languages other than English. Code function locale_is_translatable($langcode) { return $langcode != 'en' || \Drupal::config('locale.settings')->get('translate_english'); }

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_help

locale_help($route_name, RouteMatchInterface $route_match) Implements hook_help(). File core/modules/locale/locale.module, line 144 Enables the translation of the user interface to languages other than English. Code function locale_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.locale': $output = ''; $output .= '<h3>' . t('About') . '</h3>'; $output .= '<p>' . t('The Interface Translation module allows you

locale_get_plural

locale_get_plural($count, $langcode = NULL) Returns plural form index for a specific number. The index is computed from the formula of this language. Parameters $count: Number to return plural for. $langcode: Optional language code to translate to a language other than what is used to display the page. Return value The numeric index of the plural variant to use for this $langcode and $count combination or -1 if the language was not found or does not have a plural formula. File core/modules/lo

locale_form_system_file_system_settings_alter

locale_form_system_file_system_settings_alter(&$form, FormStateInterface $form_state) Implements hook_form_FORM_ID_alter() for system_file_system_settings(). Add interface translation directory setting to directories configuration. File core/modules/locale/locale.module, line 752 Enables the translation of the user interface to languages other than English. Code function locale_form_system_file_system_settings_alter(&$form, FormStateInterface $form_state) { $form['translation_path']

locale_form_language_admin_overview_form_alter

locale_form_language_admin_overview_form_alter(&$form, FormStateInterface $form_state) Implements hook_form_FORM_ID_alter() for language_admin_overview_form(). File core/modules/locale/locale.module, line 623 Enables the translation of the user interface to languages other than English. Code function locale_form_language_admin_overview_form_alter(&$form, FormStateInterface $form_state) { $languages = $form['languages']['#languages']; $total_strings = \Drupal::service('locale.stor