#332725: locale_inc_callback() is a thing of the past. From: Damien Tournoud This was used to call functions in locale.inc... We don't need that anymore with the registry. --- modules/locale/locale.module | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-) diff --git modules/locale/locale.module modules/locale/locale.module index 49750b4..fdf0b92 100644 --- modules/locale/locale.module +++ modules/locale/locale.module @@ -176,16 +176,6 @@ function locale_menu() { } /** - * Wrapper function to be able to set callbacks in locale.inc - */ -function locale_inc_callback() { - $args = func_get_args(); - $function = array_shift($args); - include_once DRUPAL_ROOT . '/includes/locale.inc'; - return call_user_func_array($function, $args); -} - -/** * Implementation of hook_perm(). */ function locale_perm() { @@ -529,10 +519,12 @@ function locale_update_js_files() { if (!in_array($filepath, $parsed)) { // Don't parse our own translations files. if (substr($filepath, 0, strlen($dir)) != $dir) { - locale_inc_callback('_locale_parse_js_file', $filepath); - watchdog('locale', 'Parsed JavaScript file %file.', array('%file' => $filepath)); - $parsed[] = $filepath; - $new_files = TRUE; + if (drupal_function_exists('_locale_parse_js_file')) { + _locale_parse_js_file($filepath); + watchdog('locale', 'Parsed JavaScript file %file.', array('%file' => $filepath)); + $parsed[] = $filepath; + $new_files = TRUE; + } } } } @@ -541,15 +533,15 @@ function locale_update_js_files() { // If there are any new source files we parsed, invalidate existing // JavaScript translation files for all languages, adding the refresh // flags into the existing array. - if ($new_files) { - $parsed += locale_inc_callback('_locale_invalidate_js'); + if ($new_files && drupal_function_exists('_locale_invalidate_js')) { + $parsed += _locale_invalidate_js(); } // If necessary, rebuild the translation file for the current language. if (!empty($parsed['refresh:' . $language->language])) { // Don't clear the refresh flag on failure, so that another try will // be performed later. - if (locale_inc_callback('_locale_rebuild_js')) { + if (drupal_function_exists('_locale_rebuild_js') && _locale_rebuild_js()) { unset($parsed['refresh:' . $language->language]); } // Store any changes after refresh was attempted.