允许获取当前默认的语言

This commit is contained in:
Yun
2024-08-11 23:35:18 +08:00
parent 3a4c3e58e6
commit f66e76883f
+5
View File
@@ -267,6 +267,11 @@ func GetDefaultCode() int {
return l.ops.defaultCode
}
// 获取默认语言
func GetDefaultLang() string {
return l.ops.defaultLang
}
func getLangFromCtx(ctx context.Context) string {
ctxVal := ctx.Value(l.ops.ctxLangKey)
lang := l.ops.defaultLang