From 6cb4345c6cfb03463955180d5c5d6b144b89d6cd Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 4 Nov 2005 02:16:05 +0000 Subject: [PATCH] Added method to get the Locale object that the client is using. This may be different from the default Locale. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3746 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/util/MessageManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/java/com/threerings/util/MessageManager.java b/src/java/com/threerings/util/MessageManager.java index 36600c946..a7069df0a 100644 --- a/src/java/com/threerings/util/MessageManager.java +++ b/src/java/com/threerings/util/MessageManager.java @@ -81,6 +81,17 @@ public class MessageManager _global = getBundle(GLOBAL_BUNDLE); } + /** + * Get the locale that is being used to translate messages. + * This may be useful if using standard translations, for example + * new SimpleDateFormat("EEEE", getLocale()) to get the name of a weekday + * that matches the language being used for all other client translations. + */ + public Locale getLocale () + { + return _locale; + } + /** * Sets the locale to the specified locale. Subsequent message bundles * fetched via the message manager will use the new locale. The