function _locale_invalidate_js

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

Force the JavaScript translation file(s) to be refreshed.

This function sets a refresh flag for a specified language, or all languages except English, if none specified. JavaScript translation files are rebuilt (with locale_update_js_files()) the next time a request is served in that language.

Parameters

string|null $langcode: (optional) The language code for which the file needs to be refreshed, or NULL to refresh all languages. Defaults to NULL.

Return value

array New content of the 'system.javascript_parsed' variable.

Deprecated

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

See also

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

File

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

Code

function _locale_invalidate_js($langcode = NULL) {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal::service(LocaleJs::class)->invalidate() instead. See https://www.drupal.org/node/3619103', E_USER_DEPRECATED);
  return \Drupal::service(LocaleJs::class)->invalidate($langcode);
}

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