Add a command to reload locale

This commit is contained in:
Mark Vainomaa
2019-04-30 21:19:55 +03:00
parent 0c8b001d05
commit 40ea101bf6
6 changed files with 63 additions and 1 deletions

View File

@@ -47,6 +47,17 @@ public final class LocaleLoader {
return formatString(rawMessage, messageArguments);
}
/**
* Reloads locale
*/
public static void reloadLocale() {
bundle = null;
filesystemBundle = null;
enBundle = null;
bundleCache = new HashMap<>(); // Cheaper to replace than clear()
initialize();
}
private static String getRawString(String key) {
if (filesystemBundle != null) {
try {