推送通知适配多语言

This commit is contained in:
2026-08-28 11:16:44 +08:00
parent c6f9e191b9
commit fc400bc647
3 changed files with 39 additions and 15 deletions

View File

@@ -102,11 +102,26 @@ class AppUtils {
}
return MMKVUtil.getBoolean(MMKVKey.DebugIp, true)
}
val locale = Locale.getDefault()
val lang = locale.country.uppercase() + "-" + locale.language.uppercase()
val lang = getCountry().uppercase() + "-" + getLanguage().uppercase()
return lang.contains("CN") || lang.contains("ZH")
}
/**
* 获取系统国家地区
*/
fun getCountry(): String {
val locale = Locale.getDefault()
return locale.country
}
/**
* 获取系统语言
*/
fun getLanguage(): String {
val locale = Locale.getDefault()
return locale.language
}
/**
* 判断是否是深色模式
*/