mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-03 01:19:58 +01:00
Merge branch 'master' of github.com:essentials/Essentials
This commit is contained in:
commit
a4d7b5dcf8
@ -126,23 +126,25 @@ public class EssentialsConf extends YamlConfiguration
|
||||
{
|
||||
buffer.rewind();
|
||||
data.clear();
|
||||
LOGGER.log(Level.INFO, "File {0} is not utf-8 encoded, trying {1}", new Object[]
|
||||
{
|
||||
configFile.getAbsolutePath().toString(), Charset.defaultCharset().displayName()
|
||||
});
|
||||
LOGGER.log(Level.INFO, "File " + configFile.getAbsolutePath().toString() + "is not utf-8 encoded, trying " + Charset.defaultCharset().displayName());
|
||||
decoder = Charset.defaultCharset().newDecoder();
|
||||
result = decoder.decode(buffer, data, true);
|
||||
if (result.isError())
|
||||
{
|
||||
throw new InvalidConfigurationException("Invalid Characters in file " + configFile.getAbsolutePath().toString());
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
decoder.flush(data);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
decoder.flush(data);
|
||||
}
|
||||
final int end = data.position();
|
||||
data.rewind();
|
||||
super.loadFromString(data.toString());
|
||||
super.loadFromString(data.subSequence(0, end).toString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -114,6 +114,7 @@ public class I18n implements II18n
|
||||
{
|
||||
currentLocale = new Locale(parts[0], parts[1], parts[2]);
|
||||
}
|
||||
ResourceBundle.clearCache();
|
||||
Logger.getLogger("Minecraft").log(Level.INFO, String.format("Using locale %s", currentLocale.toString()));
|
||||
customBundle = ResourceBundle.getBundle(MESSAGES, currentLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess));
|
||||
localeBundle = ResourceBundle.getBundle(MESSAGES, currentLocale);
|
||||
|
Loading…
Reference in New Issue
Block a user