mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-01-28 19:21:48 +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);
|
Message.AVAILABLE_TRANSLATIONS_HEADER.send(sender);
|
||||||
for (LanguageInfo language : availableTranslations) {
|
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()));
|
sender.sendMessage(Message.prefixed(Component.empty()));
|
||||||
Message.TRANSLATIONS_DOWNLOAD_PROMPT.send(sender, label);
|
Message.TRANSLATIONS_DOWNLOAD_PROMPT.send(sender, label);
|
||||||
@ -168,6 +168,23 @@ public class TranslationsCommand extends SingleCommand {
|
|||||||
return languages;
|
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 static final class LanguageInfo {
|
||||||
private final String id;
|
private final String id;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
Loading…
Reference in New Issue
Block a user