mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-01-15 12:51:32 +01:00
Improve locale display names
This commit is contained in:
parent
7b3beae57f
commit
4c23f93a67
@ -98,7 +98,7 @@ public class TranslationsCommand extends SingleCommand {
|
||||
|
||||
Message.AVAILABLE_TRANSLATIONS_HEADER.send(sender);
|
||||
for (LanguageInfo language : availableTranslations) {
|
||||
Message.AVAILABLE_TRANSLATIONS_ENTRY.send(sender, language.locale.toString(), language.locale.getDisplayLanguage(language.locale), language.progress, language.contributors);
|
||||
Message.AVAILABLE_TRANSLATIONS_ENTRY.send(sender, language.locale.toString(), localeDisplayName(language.locale), language.progress, language.contributors);
|
||||
}
|
||||
sender.sendMessage(Message.prefixed(Component.empty()));
|
||||
Message.TRANSLATIONS_DOWNLOAD_PROMPT.send(sender, label);
|
||||
@ -168,6 +168,23 @@ public class TranslationsCommand extends SingleCommand {
|
||||
return languages;
|
||||
}
|
||||
|
||||
private static String localeDisplayName(Locale locale) {
|
||||
if (locale.getLanguage().equals("zh")) {
|
||||
if (locale.getCountry().equals("CN")) {
|
||||
return "简体中文"; // Chinese (Simplified)
|
||||
} else if (locale.getCountry().equals("TW")) {
|
||||
return "繁體中文"; // Chinese (Traditional)
|
||||
}
|
||||
return locale.getDisplayCountry(locale) + locale.getDisplayLanguage(locale);
|
||||
}
|
||||
|
||||
if (locale.getLanguage().equals("en") && locale.getCountry().equals("PT")) {
|
||||
return "Pirate";
|
||||
}
|
||||
|
||||
return locale.getDisplayLanguage(locale);
|
||||
}
|
||||
|
||||
private static final class LanguageInfo {
|
||||
private final String id;
|
||||
private final String name;
|
||||
|
Loading…
Reference in New Issue
Block a user