Skip to content

Commit

Permalink
Use lowercase locale
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jun 11, 2024
1 parent db78e6b commit 75213ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
27 changes: 13 additions & 14 deletions src/main/java/cn/dreeam/caeruleum/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public interface Config {
"Leave here blank if every i18n content that corresponds to perms."
})
@ConfDefault.DefaultStrings({
"zh_CN",
"zh_HK",
"zh_TW",
"zh_cn",
"zh_hk",
"zh_tw",
"lzh"
})
@AnnotationBasedSorter.Order(3)
Expand Down Expand Up @@ -72,7 +72,7 @@ public interface Config {
"The fallback locale, if any unknown or unsupported locale found when player join/change locale,",
"CaeruleumCore will assign lang permission based on the fallback locale here."
})
@ConfDefault.DefaultString("en_US")
@ConfDefault.DefaultString("en_us")
@AnnotationBasedSorter.Order(6)
String localeBlackWhiteListFallback();

Expand All @@ -91,11 +91,11 @@ public interface Config {
"As blacklist, CaeruleumCore will fallback to fallback-locale for any locales in the list if players have."
})
@ConfDefault.DefaultStrings({
"zh_CN",
"zh_HK",
"zh_TW",
"zh_cn",
"zh_hk",
"zh_tw",
"lzh",
"en_US"
"en_us"
})
@AnnotationBasedSorter.Order(8)
List<String> localeBlackWhiteList();
Expand All @@ -104,17 +104,16 @@ public interface Config {
@ConfComments({
"Redirect locale code to certain locale code as you want",
"Minecraft locale list: https://minecraft.wiki/w/Language",
"AuthMe language code: https://github.com/HaHaWTH/AuthMeReReloaded/blob/master/docs/translations.md",
"For example, if you want to show Russian messages to player using language Tatar(tt_ru),",
"and show Chinese Simplified messages to player using language Classical Chinese(lzh), then:",
"locale-code-redirect-list:",
"- 'tt_ru:ru'",
"- 'lzh:zhcn'"
"- 'tt_ru:ru_ru'",
"- 'lzh:zh_cn'"
})
@ConfDefault.DefaultStrings({
"lzh:zh_CN",
"zh_HK:zh_CN",
"zh_TW:zh_CN",
"lzh:zh_cn",
"zh_HK:zh_cn",
"zh_TW:zh_cn",
})
@AnnotationBasedSorter.Order(9)
List<String> localeRedirectList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void onLocaleChange(PlayerLocaleChangeEvent e) {
return;
}

String locale = e.locale().toString();
String locale = e.locale().toString().toLowerCase();
List<String> langPerms = PermUtil.getLangPerm(uuid);

// Remove invalid perms
Expand Down

0 comments on commit 75213ad

Please sign in to comment.