mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
添加多语言最基础代码
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/rpc"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
@@ -148,3 +149,12 @@ func (this *ParentAction) AdminContext() context.Context {
|
||||
func (this *ParentAction) ViewData() maps.Map {
|
||||
return this.Data
|
||||
}
|
||||
|
||||
func (this *ParentAction) Lang() string {
|
||||
var lang = configloaders.FindAdminLang(this.AdminId())
|
||||
if len(lang) > 0 {
|
||||
// TODO check language still exists
|
||||
return lang
|
||||
}
|
||||
return langs.ParseLangFromAction(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user