diff options
-rw-r--r-- | modules/locale/locale.module | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 1d9a9a985..cfb0928ce 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -315,13 +315,20 @@ function locale_theme() { * used on the page. * @param $langcode * Language code to use for the lookup. + * @param $reset + * Set to TRUE to reset the in-memory cache. */ -function locale($string = NULL, $langcode = NULL) { +function locale($string = NULL, $langcode = NULL, $reset = FALSE) { global $language; static $locale_t; - // Return all cached strings if no string was specified + if ($reset) { + // Reset in-memory cache. + unset($locale_t); + } + if (!isset($string)) { + // Return all cached strings if no string was specified return $locale_t; } |