| 6 locale.inc | _locale_invalidate_js($langcode = NULL) |
| 7 locale.inc | _locale_invalidate_js($langcode = NULL) |
| 8 locale.module | _locale_invalidate_js($langcode = NULL) |
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
$langcode: The language code for which the file needs to be refreshed.
Return value
New content of the 'javascript_parsed' variable.
Related topics
5 calls to _locale_invalidate_js()
File
- includes/
locale.inc, line 1968 - Administration functions for locale.module.
Code
function _locale_invalidate_js($langcode = NULL) {
$parsed = variable_get('javascript_parsed', array());
if (empty($langcode)) {
// Invalidate all languages.
$languages = language_list();
unset($languages['en']);
foreach ($languages as $lcode => $data) {
$parsed['refresh:' . $lcode] = 'waiting';
}
}
else {
// Invalidate single language.
$parsed['refresh:' . $langcode] = 'waiting';
}
variable_set('javascript_parsed', $parsed);
return $parsed;
}
Login or register to post comments