i18n翻译
This commit is contained in:
@@ -709,7 +709,7 @@ func (l *Logic) Add(ctx context.Context, key, lang, value, category string) erro
|
||||
dao.EpicI18NMappings.Columns().Status: 1,
|
||||
dao.EpicI18NMappings.Columns().CreateTime: gtime.Now(),
|
||||
dao.EpicI18NMappings.Columns().UpdateTime: gtime.Now(),
|
||||
}).OnDuplicate("value", value).Insert()
|
||||
}).Insert()
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("添加翻译失败: %v", err)
|
||||
@@ -826,11 +826,7 @@ func (l *Logic) ImportFromMap(ctx context.Context, lang string, mappings map[str
|
||||
})
|
||||
}
|
||||
|
||||
_, err := dao.EpicI18NMappings.Ctx(ctx).Data(data).OnDuplicate("value", g.Map{
|
||||
dao.EpicI18NMappings.Columns().Value: g.Map{"value": "VALUES(value)"},
|
||||
dao.EpicI18NMappings.Columns().UpdateTime: gtime.Now(),
|
||||
}).Insert()
|
||||
|
||||
_, err := dao.EpicI18NMappings.Ctx(ctx).Data(data).Insert()
|
||||
if err != nil {
|
||||
return fmt.Errorf("批量导入翻译失败: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user