update for init i18n

This commit is contained in:
shiqstone
2021-04-21 22:00:03 +08:00
parent 0fb6fcb114
commit f02ff935fe
6 changed files with 27 additions and 8 deletions

View File

@@ -116,7 +116,7 @@ func NewBook() *Book {
}
//添加一个项目
func (book *Book) Insert() error {
func (book *Book) Insert(lang string) error {
o := orm.NewOrm()
// o.Begin()
book.BookName = utils.StripTags(book.BookName)
@@ -142,7 +142,7 @@ func (book *Book) Insert() error {
}
document := NewDocument()
document.BookId = book.BookId
document.DocumentName = "空白文档"
document.DocumentName = i18n.Tr(lang, "init.blank_doc") //"空白文档"
document.MemberId = book.MemberId
err = document.InsertOrUpdate()
if err != nil {