Another translation fix for Java 8
@@ -57,11 +57,22 @@ public class Res {
public static String getString(String propertyName, Object... obj) {
String pluginString = PluginRes.getI18nRes(propertyName);
- String str = pluginString != null ? pluginString : prb.getString(propertyName);
+ String str;
+ /* Revert to this code after Spark is moved to Java 11 or newer
+ str = pluginString != null ? pluginString : prb.getString(propertyName);
if (str == null) {
return propertyName;
}
-
+ */
+ try {
+ str = pluginString != null ? pluginString : new String(prb.getString(propertyName).getBytes("ISO-8859-1"), "UTF-8");
+ if (str == null) {
+ return propertyName;
+ }
+ } catch (UnsupportedEncodingException e) {
+ Log.error(e);
+ return propertyName;
+ }
return MessageFormat.format(str, obj);
}
