function _locale_refresh_translations

Same name and namespace in other branches
  1. 10 core/modules/locale/locale.module \_locale_refresh_translations()
  2. 11.x core/modules/locale/locale.module \_locale_refresh_translations()
  3. 9 core/modules/locale/locale.module \_locale_refresh_translations()
  4. 8.9.x core/modules/locale/locale.module \_locale_refresh_translations()

Refresh related information after string translations have been updated.

The information that will be refreshed includes:

  • JavaScript translations.
  • Locale cache.
  • Render cache.

Parameters

array $langcodes: Language codes for updated translations.

array $lids: (optional) List of string identifiers that have been updated / created. If not provided, all caches for the affected languages are cleared.

Deprecated

in drupal:11.5.0 and is removed from drupal:13.0.0. Use \Drupal::service(LocaleJs::class)->refreshTranslations() instead.

See also

https://www.drupal.org/node/3619103

File

core/modules/locale/locale.module, line 704

Code

function _locale_refresh_translations($langcodes, $lids = []) : void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal::service(LocaleJs::class)->refreshTranslations() instead. See https://www.drupal.org/node/3619103', E_USER_DEPRECATED);
  \Drupal::service(LocaleJs::class)->refreshTranslations($langcodes, $lids);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.