mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-24 19:06:35 +08:00
部分中文转换为多语言代号
This commit is contained in:
@@ -150,7 +150,7 @@ func (this *ParentAction) ViewData() maps.Map {
|
||||
return this.Data
|
||||
}
|
||||
|
||||
func (this *ParentAction) Lang() string {
|
||||
func (this *ParentAction) LangCode() string {
|
||||
var lang = configloaders.FindAdminLang(this.AdminId())
|
||||
if len(lang) > 0 {
|
||||
// TODO check language still exists
|
||||
@@ -158,3 +158,15 @@ func (this *ParentAction) Lang() string {
|
||||
}
|
||||
return langs.ParseLangFromAction(this)
|
||||
}
|
||||
|
||||
func (this *ParentAction) Lang(messageCode langs.MessageCode, args ...any) string {
|
||||
return langs.Message(this.LangCode(), messageCode, args...)
|
||||
}
|
||||
|
||||
func (this *ParentAction) FailLang(messageCode langs.MessageCode, args ...any) {
|
||||
this.Fail(langs.Message(this.LangCode(), messageCode, args...))
|
||||
}
|
||||
|
||||
func (this *ParentAction) FailFieldLang(field string, messageCode langs.MessageCode, args ...any) {
|
||||
this.FailField(field, langs.Message(this.LangCode(), messageCode, args...))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user