From a7c4b2a949964ec08e9fb1d0a55bad675cb41ad8 Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Thu, 17 Mar 2011 01:33:53 +0000 Subject: [PATCH] - Allow you to optionally reload the global messages bundle when changing your locale git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6538 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../java/com/threerings/util/MessageManager.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/threerings/util/MessageManager.java b/src/main/java/com/threerings/util/MessageManager.java index 4a7deaece..f889627a1 100644 --- a/src/main/java/com/threerings/util/MessageManager.java +++ b/src/main/java/com/threerings/util/MessageManager.java @@ -95,9 +95,24 @@ public class MessageManager * manager will use the new locale. The message bundle cache will also be cleared. */ public void setLocale (Locale locale) + { + setLocale(locale, false); + } + + /** + * Sets the locale to the specified locale. Subsequent message bundles fetched via the message + * manager will use the new locale. The message bundle cache will also be cleared. + * + * @param updateGlobal set to true if you want the global bundle reloaded in the new locale + */ + public void setLocale (Locale locale, boolean updateGlobal) { _locale = locale; _cache.clear(); + + if (updateGlobal) { + _global = getBundle(GLOBAL_BUNDLE); + } } /**