[Mobile] Fix ExceptionInInitializerError forge.screens.home.NewGameMenu$NewGameScreen

- some mobile issues reported via Sentry is related to Translation errors and it should return the default original value from English locale.
This commit is contained in:
Anthony Calosa
2021-05-02 09:13:49 +08:00
parent 562ef1b147
commit 3d3296d1b7
2 changed files with 16 additions and 8 deletions

View File

@@ -58,6 +58,14 @@ public class Localizer {
return StandardCharsets.UTF_8.name();
}
public String getMessage(final String key, String defaultValue, final Object... messageArguments) {
try {
return getMessage(key, messageArguments);
} catch (Exception e) {
return defaultValue;
}
}
//FIXME: localizer should return default value from english locale or it will crash some GUI element like the NewGameMenu->NewGameScreen Popup when returned null...
public String getMessage(final String key, final Object... messageArguments) {
MessageFormat formatter = null;