function _locale_parse_js_file

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

Parses a JavaScript file, extracts translatable strings, and saves them.

Strings are extracted from both Drupal.t() and Drupal.formatPlural().

Parameters

string $filepath: File name to parse.

Throws

Exception If a non-local file is attempted to be parsed.

Deprecated

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

See also

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

File

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

Code

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

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