Index: src/js/i18n.js |
diff --git a/src/js/i18n.js b/src/js/i18n.js |
index b3a0f5b6ebd1783b8b884c462f207b82bcaf8cff..994c2328019f0fe5705ea0905479f4e17bd7ee73 100644 |
--- a/src/js/i18n.js |
+++ b/src/js/i18n.js |
@@ -1989,6 +1989,23 @@ var defaultObjects = { |
'dateformattime': UNDEFINED, |
}; |
+function clearDefaultObjects() { |
+ defaultObjects['dateformatall'] = UNDEFINED; |
+ defaultObjects['dateformatdate'] = UNDEFINED; |
+ defaultObjects['dateformattime'] = UNDEFINED; |
+} |
+ |
+var date_cache_version = 0; |
+ |
+function checkDateCacheCurrent() { |
+ var new_date_cache_version = %DateCacheVersion(); |
+ if (new_date_cache_version == date_cache_version) { |
+ return; |
+ } |
+ date_cache_version = new_date_cache_version; |
+ |
+ clearDefaultObjects(); |
+} |
/** |
* Returns cached or newly created instance of a given service. |
@@ -1997,6 +2014,7 @@ var defaultObjects = { |
function cachedOrNewService(service, locales, options, defaults) { |
var useOptions = (IS_UNDEFINED(defaults)) ? options : defaults; |
if (IS_UNDEFINED(locales) && IS_UNDEFINED(options)) { |
+ checkDateCacheCurrent(); |
if (IS_UNDEFINED(defaultObjects[service])) { |
defaultObjects[service] = new savedObjects[service](locales, useOptions); |
} |