添加多语言最基础代码

This commit is contained in:
GoEdgeLab
2023-06-28 09:14:07 +08:00
parent f29ad86b67
commit 97fe91c7b0
16 changed files with 172 additions and 70 deletions

View File

@@ -51,7 +51,7 @@ func (this *AdminAction) RunGet(params struct {
// 权限
moduleMaps := []maps.Map{}
for _, m := range configloaders.AllModuleMaps() {
for _, m := range configloaders.AllModuleMaps(this.Lang()) {
code := m.GetString("code")
isChecked := false
for _, module := range admin.Modules {

View File

@@ -20,7 +20,7 @@ func (this *CreatePopupAction) Init() {
}
func (this *CreatePopupAction) RunGet(params struct{}) {
this.Data["modules"] = configloaders.AllModuleMaps()
this.Data["modules"] = configloaders.AllModuleMaps(this.Lang())
this.Show()
}

View File

@@ -59,7 +59,7 @@ func (this *UpdateAction) RunGet(params struct {
}
// 权限
var moduleMaps = configloaders.AllModuleMaps()
var moduleMaps = configloaders.AllModuleMaps(this.Lang())
for _, m := range moduleMaps {
code := m.GetString("code")
isChecked := false

View File

@@ -39,7 +39,7 @@ func (this *IndexAction) RunGet(params struct{}) {
module, ok := configloaders.FindFirstAdminModule(this.AdminId())
if ok {
if module != "dashboard" {
for _, m := range configloaders.AllModuleMaps() {
for _, m := range configloaders.AllModuleMaps(this.Lang()) {
if m.GetString("code") == module {
this.RedirectURL(m.GetString("url"))
return