You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
478 B
26 lines
478 B
6 months ago
|
package initialize
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"shop-api/global"
|
||
|
"shop-api/model"
|
||
|
)
|
||
|
|
||
|
func InternationalizationInit() interface{} {
|
||
|
var (
|
||
|
err error
|
||
|
data []model.Internationalization
|
||
|
language = make(map[string]model.Internationalization)
|
||
|
)
|
||
|
err = global.MG_DB.Model(&model.Internationalization{}).Find(&data).Error
|
||
|
if err != nil {
|
||
|
fmt.Println("多语言模块加载失败")
|
||
|
return nil
|
||
|
}
|
||
|
for v := range data {
|
||
|
language[data[v].Ch] = data[v]
|
||
|
}
|
||
|
return language
|
||
|
}
|