mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-15 11:04:29 +02:00
Reload locale even if it is set to null.
This commit is contained in:
@@ -123,22 +123,21 @@ public class I18n implements net.ess3.api.II18n
|
|||||||
|
|
||||||
public void updateLocale(final String loc)
|
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)
|
||||||
final String[] parts = loc.split("[_\\.]");
|
{
|
||||||
if (parts.length == 1)
|
currentLocale = new Locale(parts[0]);
|
||||||
{
|
}
|
||||||
currentLocale = new Locale(parts[0]);
|
if (parts.length == 2)
|
||||||
}
|
{
|
||||||
if (parts.length == 2)
|
currentLocale = new Locale(parts[0], parts[1]);
|
||||||
{
|
}
|
||||||
currentLocale = new Locale(parts[0], parts[1]);
|
if (parts.length == 3)
|
||||||
}
|
{
|
||||||
if (parts.length == 3)
|
currentLocale = new Locale(parts[0], parts[1], parts[2]);
|
||||||
{
|
}
|
||||||
currentLocale = new Locale(parts[0], parts[1], parts[2]);
|
|
||||||
}
|
}
|
||||||
ResourceBundle.clearCache();
|
ResourceBundle.clearCache();
|
||||||
messageFormatCache = new HashMap<String, MessageFormat>();
|
messageFormatCache = new HashMap<String, MessageFormat>();
|
||||||
|
Reference in New Issue
Block a user