chore: improve geo

This commit is contained in:
hstyi
2025-06-28 11:13:26 +08:00
committed by GitHub
parent 54116a4bf5
commit fff2dd89c7
8 changed files with 22 additions and 187 deletions

View File

@@ -1,6 +1,7 @@
package app.termora
import org.apache.commons.lang3.LocaleUtils
import org.apache.commons.lang3.StringUtils
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.util.*
@@ -33,6 +34,13 @@ object I18n : AbstractI18n() {
return null
}
/**
* 如果使用 zh_CN 则定义为中国大陆用户,应当优先使用国内服务器
*/
fun isChinaMainland(): Boolean {
return StringUtils.equalsIgnoreCase(containsLanguage(Locale.getDefault()), "zh_CN")
}
fun getLanguages(): Map<String, String> {
return supportedLanguages
}