summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-05-05 20:47:48 +0100
committerKHobbits <rob@khobbits.co.uk>2014-05-05 20:47:48 +0100
commit0ae1d13c3415652ac40d8a2be5d1c14603787567 (patch)
treeb1362388b9c55ba0727e503bd456852823b70e41
parentbe6b1f7432159d2b17667a2591f4db8331dfe79b (diff)
downloadEssentials-0ae1d13c3415652ac40d8a2be5d1c14603787567.tar
Essentials-0ae1d13c3415652ac40d8a2be5d1c14603787567.tar.gz
Essentials-0ae1d13c3415652ac40d8a2be5d1c14603787567.tar.lz
Essentials-0ae1d13c3415652ac40d8a2be5d1c14603787567.tar.xz
Essentials-0ae1d13c3415652ac40d8a2be5d1c14603787567.zip
Reload locale even if it is set to null.
-rw-r--r--Essentials/src/com/earth2me/essentials/I18n.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/Essentials/src/com/earth2me/essentials/I18n.java b/Essentials/src/com/earth2me/essentials/I18n.java
index 507cd9b02..3cf8c3a5d 100644
--- a/Essentials/src/com/earth2me/essentials/I18n.java
+++ b/Essentials/src/com/earth2me/essentials/I18n.java
@@ -123,22 +123,21 @@ public class I18n implements net.ess3.api.II18n
public void updateLocale(final String loc)
{
- if (loc == null || loc.isEmpty())
+ if (loc != null && !loc.isEmpty())
{
- return;
- }
- final String[] parts = loc.split("[_\\.]");
- if (parts.length == 1)
- {
- currentLocale = new Locale(parts[0]);
- }
- if (parts.length == 2)
- {
- currentLocale = new Locale(parts[0], parts[1]);
- }
- if (parts.length == 3)
- {
- currentLocale = new Locale(parts[0], parts[1], parts[2]);
+ final String[] parts = loc.split("[_\\.]");
+ if (parts.length == 1)
+ {
+ currentLocale = new Locale(parts[0]);
+ }
+ if (parts.length == 2)
+ {
+ currentLocale = new Locale(parts[0], parts[1]);
+ }
+ if (parts.length == 3)
+ {
+ currentLocale = new Locale(parts[0], parts[1], parts[2]);
+ }
}
ResourceBundle.clearCache();
messageFormatCache = new HashMap<String, MessageFormat>();