aeus-admin/i18n/zh.go

53 lines
1.2 KiB
Go

package i18n
import (
"git.nobla.cn/golang/aeus-admin/models"
"git.nobla.cn/golang/rest"
"git.nobla.cn/golang/rest/types"
)
type ZH struct {
}
func (t *ZH) Menu(model *rest.Model, label string) string {
if _, ok := model.Value().Interface().(models.Menu); ok {
return "菜单管理"
}
if _, ok := model.Value().Interface().(models.User); ok {
return "用户管理"
}
if _, ok := model.Value().Interface().(models.Role); ok {
return "角色管理"
}
if _, ok := model.Value().Interface().(models.Permission); ok {
return "权限管理"
}
if _, ok := model.Value().Interface().(models.Department); ok {
return "部门管理"
}
if _, ok := model.Value().Interface().(models.RolePermission); ok {
return "角色权限"
}
return label
}
func (t *ZH) Permission(model *rest.Model, scene string, label string) string {
switch scene {
case types.ScenarioList:
return "查看"
case types.ScenarioCreate:
return "新增"
case types.ScenarioUpdate:
return "修改"
case types.ScenarioDelete:
return "删除"
case types.ScenarioView:
return "详情"
case types.ScenarioExport:
return "导出"
case types.ScenarioImport:
return "导入"
}
return label
}