W3cubDocs

/Drupal 8

locale.module

Enables the translation of the user interface to languages other than English.

When enabled, multiple languages can be added. The site interface can be displayed in different languages, and nodes can have languages assigned. The setup of languages and translations is completely web based. Gettext portable object files are supported.

File

core/modules/locale/locale.module

Functions

Name Description
locale_cache_flush Implements hook_cache_flush().
locale_configurable_language_delete Implements hook_ENTITY_TYPE_delete() for 'configurable_language'.
locale_configurable_language_insert Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.
locale_configurable_language_update Implements hook_ENTITY_TYPE_update() for 'configurable_language'.
locale_cron Implements hook_cron().
locale_form_language_admin_add_form_alter Implements hook_form_FORM_ID_alter() for language_admin_add_form().
locale_form_language_admin_add_form_alter_submit Form submission handler for language_admin_add_form().
locale_form_language_admin_edit_form_alter Implements hook_form_FORM_ID_alter() for language_admin_edit_form().
locale_form_language_admin_edit_form_alter_submit Form submission handler for language_admin_edit_form().
locale_form_language_admin_overview_form_alter Implements hook_form_FORM_ID_alter() for language_admin_overview_form().
locale_form_system_file_system_settings_alter Implements hook_form_FORM_ID_alter() for system_file_system_settings().
locale_get_plural Returns plural form index for a specific number.
locale_help Implements hook_help().
locale_is_translatable Checks whether $langcode is a language supported as a locale target.
locale_js_alter Implements hook_js_alter().
locale_js_settings_alter Implements hook_js_settings_alter().
locale_js_translate Returns a list of translation files given a list of JavaScript files.
locale_library_info_alter Implements hook_library_info_alter().
locale_modules_installed Implements hook_modules_installed().
locale_module_preuninstall Implements hook_module_preuninstall().
locale_preprocess_node Implements hook_preprocess_HOOK() for node templates.
locale_string_is_safe Check that a string is safe to be added or imported as a translation.
locale_system_file_system_settings_submit Submit handler for the file system settings form.
locale_system_remove Delete translation history of modules and themes.
locale_system_set_config_langcodes Updates default configuration when new modules or themes are installed.
locale_system_update Imports translations when new modules or themes are installed.
locale_theme Implements hook_theme().
locale_themes_installed Implements hook_themes_installed().
locale_themes_uninstalled Implements hook_themes_uninstalled().
locale_translatable_language_list Returns list of translatable languages.
locale_translation_clear_status Clear the translation status cache.
locale_translation_file_history_delete Deletes the history of downloaded translations.
locale_translation_get_file_history Gets current translation status from the {locale_file} table.
locale_translation_get_status Gets the current translation status.
locale_translation_language_table Form element callback: After build changes to the language update table.
locale_translation_status_delete_languages Delete language entries from the status cache.
locale_translation_status_delete_projects Delete project entries from the status cache.
locale_translation_status_save Saves the status of translation sources in static cache.
locale_translation_update_file_history Updates the {locale_file} table.
locale_translation_use_remote_source Checks whether remote translation sources are used.
_locale_invalidate_js Force the JavaScript translation file(s) to be refreshed.
_locale_parse_js_file Parses a JavaScript file, extracts strings wrapped in Drupal.t() and Drupal.formatPlural() and inserts them into the database.
_locale_rebuild_js (Re-)Creates the JavaScript translation file for a language.
_locale_refresh_configuration Refreshes configuration after string translations have been updated.
_locale_refresh_translations Refresh related information after string translations have been updated.
_locale_strip_quotes Removes the quotes and string concatenations from the string.

Constants

Name Description
LOCALE_CUSTOMIZED Flag for locally customized interface translation.
LOCALE_JS_OBJECT Regular expression pattern used to match simple JS object literal.
LOCALE_JS_OBJECT_CONTEXT Regular expression to match an object containing a key 'context'.
LOCALE_JS_STRING Regular expression pattern used to localize JavaScript strings.
LOCALE_NOT_CUSTOMIZED Flag for locally not customized interface translation.
LOCALE_TRANSLATION_CURRENT Translation source is the current translation.
LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN Default location of gettext file on the translation server.
LOCALE_TRANSLATION_LOCAL Translation source is a local file.
LOCALE_TRANSLATION_OVERWRITE_ALL UI option for override of existing translations. Override any translation.
LOCALE_TRANSLATION_OVERWRITE_NONE UI option for override of existing translations. Don't override existing translations.
LOCALE_TRANSLATION_OVERWRITE_NON_CUSTOMIZED UI option for override of existing translations. Only override non-customized translations.
LOCALE_TRANSLATION_REMOTE Translation source is a remote file.
LOCALE_TRANSLATION_STATUS_TTL The number of seconds that the translations status entry should be considered.
LOCALE_TRANSLATION_USE_SOURCE_LOCAL Translation update mode: Use local files only.
LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL Translation update mode: Use both remote and local files.

© 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.module/8.1.x