locale_translate_batch_build

locale_translate_batch_build(array $files, array $options) Build a locale batch from an array of files. Parameters array $files: Array of file objects to import. array $options: An array with options that can have the following elements: 'langcode': The language code. Optional, defaults to NULL, which means that the language will be detected from the name of the files. 'overwrite_options': Overwrite options array as defined in Drupal\locale\PoDatabaseWriter. Optional, defaults to an empty ar

locale_translatable_language_list

locale_translatable_language_list() Returns list of translatable languages. Return value array Array of installed languages keyed by language name. English is omitted unless it is marked as translatable. File core/modules/locale/locale.module, line 251 Enables the translation of the user interface to languages other than English. Code function locale_translatable_language_list() { $languages = \Drupal::languageManager()->getLanguages(); if (!locale_is_translatable('en')) { unset($

locale_themes_uninstalled

locale_themes_uninstalled($themes) Implements hook_themes_uninstalled(). File core/modules/locale/locale.module, line 343 Enables the translation of the user interface to languages other than English. Code function locale_themes_uninstalled($themes) { $components['theme'] = $themes; locale_system_remove($components); }

locale_themes_installed

locale_themes_installed($themes) Implements hook_themes_installed(). File core/modules/locale/locale.module, line 333 Enables the translation of the user interface to languages other than English. Code function locale_themes_installed($themes) { locale_system_set_config_langcodes(); $components['theme'] = $themes; locale_system_update($components); }

locale_theme

locale_theme() Implements hook_theme(). File core/modules/locale/locale.module, line 184 Enables the translation of the user interface to languages other than English. Code function locale_theme() { return array( 'locale_translation_last_check' => array( 'variables' => array('last' => NULL), 'file' => 'locale.pages.inc', ), 'locale_translation_update_info' => array( 'variables' => array('updates' => array(), 'not_found' => array()),

locale_system_update

locale_system_update(array $components) Imports translations when new modules or themes are installed. This function will start a batch to import translations for the added components. Parameters array $components: An array of arrays of component (theme and/or module) names to import translations for, indexed by type. File core/modules/locale/locale.module, line 401 Enables the translation of the user interface to languages other than English. Code function locale_system_update(array $compon

locale_system_set_config_langcodes

locale_system_set_config_langcodes() Updates default configuration when new modules or themes are installed. File core/modules/locale/locale.module, line 366 Enables the translation of the user interface to languages other than English. Code function locale_system_set_config_langcodes() { // Need to rewrite some default configuration language codes if the default // site language is not English. $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); if ($

locale_system_remove

locale_system_remove($components) Delete translation history of modules and themes. Only the translation history is removed, not the source strings or translations. This is not possible because strings are shared between modules and we have no record of which string is used by which module. Parameters array $components: An array of arrays of component (theme and/or module) names to import translations for, indexed by type. File core/modules/locale/locale.module, line 448 Enables the translatio

locale_system_file_system_settings_submit

locale_system_file_system_settings_submit(&$form, FormStateInterface $form_state) Submit handler for the file system settings form. Clears the translation status when the Interface translations directory changes. Without a translations directory local po files in the directory should be ignored. The old translation status is no longer valid. File core/modules/locale/locale.module, line 776 Enables the translation of the user interface to languages other than English. Code function locale_

locale_string_is_safe

locale_string_is_safe($string) Check that a string is safe to be added or imported as a translation. This test can be used to detect possibly bad translation strings. It should not have any false positives. But it is only a test, not a transformation, as it destroys valid HTML. We cannot reliably filter translation strings on import because some strings are irreversibly corrupted. For example, a & in the translation would get encoded to & by \Drupal\Component\Utility\Xss::fi