preserve sdk host language state

This commit is contained in:
ZacharyZcR
2026-05-18 17:43:00 +08:00
parent c0a9cfd8f5
commit 5942d3bbcb
3 changed files with 87 additions and 0 deletions
+7
View File
@@ -51,6 +51,13 @@ func SetLanguage(l string) {
localizer = i18n.NewLocalizer(bundle, lang, FallbackLanguage)
}
// GetLanguage returns the currently configured language.
func GetLanguage() string {
mu.RLock()
defer mu.RUnlock()
return lang
}
// GetText 获取国际化文本(无参数)
func GetText(key string) string {
mu.RLock()