summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-04 16:04:49 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-04 16:04:49 +0000
commit98d7931e5b6d23f39603f23ec21ea9b280a5a544 (patch)
tree4e4349de06b817a875baee3800e453f1f9d890db
parenta55520227686fe6ea5b1a003cb0c91538dfc9d55 (diff)
downloadbrdo-98d7931e5b6d23f39603f23ec21ea9b280a5a544.tar.gz
brdo-98d7931e5b6d23f39603f23ec21ea9b280a5a544.tar.bz2
#206232 by chx with a bit of cleanup: add in-memory reset clearing to locale() to help it interact with simpletests, which are not reloading the Drupal instance on form submits
-rw-r--r--modules/locale/locale.module11
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;
}