function locale_js_alter

You are here

7 locale.module locale_js_alter(&$javascript)
8 locale.module locale_js_alter(&$javascript)

Implements hook_js_alter().

File

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

Code

function locale_js_alter(&$javascript) {
  $files = array();
  foreach ($javascript as $item) {
    if (isset($item['type']) && $item['type'] == 'file') {
      $files[] = $item['data'];
    }
  }
  if ($translation_file = locale_js_translate($files)) {
    $javascript[$translation_file] = drupal_js_defaults($translation_file);
  }
}