_locale_parse_js_file

function _locale_parse_js_file

_locale_parse_js_file($filepath)

Parses a JavaScript file, extracts strings wrapped in Drupal.t() and Drupal.formatPlural() and inserts them into the database.

Parameters

string $filepath: File name to parse.

Return value

array Array of string objects to update indexed by context and source.

Throws

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

File

core/modules/locale/locale.module, line 1133
Enables the translation of the user interface to languages other than English.

Code

function _locale_parse_js_file($filepath) {
  // The file path might contain a query string, so make sure we only use the
  // actual file.
  $parsed_url = UrlHelper::parse($filepa