mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 17:05:20 +01:00
Fix for translation errors
This commit is contained in:
@@ -29,7 +29,13 @@ public final class Language {
|
||||
* @return A translated value with arguments substituted.
|
||||
*/
|
||||
public static String translate(String key, Object... args) {
|
||||
return Grasscutter.getLanguage().get(key).formatted(args);
|
||||
String translated = Grasscutter.getLanguage().get(key);
|
||||
try {
|
||||
return translated.formatted(args);
|
||||
} catch (Exception exception) {
|
||||
Grasscutter.getLogger().error("Failed to format string: " + key, exception);
|
||||
return translated;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user