Skip to content

Commit ff7c952

Browse files
authored
Fix per-player locale for messages with arguments (#6227)
Fixes #6029
1 parent 0417624 commit ff7c952

File tree

1 file changed

+2
-6
lines changed
  • Essentials/src/main/java/com/earth2me/essentials

1 file changed

+2
-6
lines changed

Essentials/src/main/java/com/earth2me/essentials/I18n.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static String tlLocale(final Locale locale, final String tlKey, final Obj
9292
if (objects.length == 0) {
9393
return NODOUBLEMARK.matcher(instance.translate(locale, tlKey)).replaceAll("'");
9494
} else {
95-
return instance.format(tlKey, objects);
95+
return instance.format(locale, tlKey, objects);
9696
}
9797
}
9898

@@ -162,10 +162,6 @@ private String translate(final Locale locale, final String string) {
162162
}
163163
}
164164

165-
private String format(final String string, final Object... objects) {
166-
return format(currentLocale, string, objects);
167-
}
168-
169165
private String format(final Locale locale, final String string, final Object... objects) {
170166
String format = translate(locale, string);
171167

@@ -281,7 +277,7 @@ public InputStream getResourceAsStream(final String string) {
281277
* Reads .properties files as UTF-8 instead of ISO-8859-1, which is the default on Java 8/below.
282278
* Java 9 fixes this by defaulting to UTF-8 for .properties files.
283279
*/
284-
private static class UTF8PropertiesControl extends ResourceBundle.Control {
280+
private static final class UTF8PropertiesControl extends ResourceBundle.Control {
285281
public ResourceBundle newBundle(final String baseName, final Locale locale, final String format, final ClassLoader loader, final boolean reload) throws IOException {
286282
final String resourceName = toResourceName(toBundleName(baseName, locale), "properties");
287283
ResourceBundle bundle = null;

0 commit comments

Comments
 (0)