Commit 98d7931e authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#206232 by chx with a bit of cleanup: add in-memory reset clearing to locale()...

#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
parent a5552022
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment