pre update for config comment I18n support

This commit is contained in:
Helvetica Volubi
2026-07-24 20:34:55 +08:00
parent 1cbb19d9e4
commit 5f718d45a1
115 changed files with 522 additions and 677 deletions
@@ -271,6 +271,7 @@ public class ServerI18nUtil {
private static void loadLophineI18n(BiConsumer<String, String> bi) {
if (Language.class.getResource(lophineLangPath) != null) {
Language.parseTranslations(bi, lophineLangPath);
if (LanguageConfig.allowAutoResetComments) ConfigManager.reloadComments();
} else {
loadLophineI18nDefault(bi);
}
@@ -297,6 +298,12 @@ public class ServerI18nUtil {
}
}
public static String getLocalizedComment(String key) {
String current = Language.getInstance().getOrDefault(key, "");
if (!current.isBlank()) return current;
return Language.DEFAULT_INSTANCE.getOrDefault(key, "");
}
private static class UnsupportedLanguageException extends Exception {
}