[add] default lang
This commit is contained in:
parent
256912f5e8
commit
dafe256d53
1 changed files with 2 additions and 5 deletions
|
|
@ -45,10 +45,6 @@ func LoadAndExport(cfg config.Config) error {
|
||||||
// Load the app DSL
|
// Load the app DSL
|
||||||
func Load(cfg config.Config) error {
|
func Load(cfg config.Config) error {
|
||||||
|
|
||||||
if os.Getenv("YAO_LANG") == "" {
|
|
||||||
os.Setenv("YAO_LANG", "en-us")
|
|
||||||
}
|
|
||||||
|
|
||||||
file := filepath.Join(cfg.Root, "app.json")
|
file := filepath.Join(cfg.Root, "app.json")
|
||||||
file, err := filepath.Abs(file)
|
file, err := filepath.Abs(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -60,7 +56,7 @@ func Load(cfg config.Config) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
dsl := &DSL{Optional: OptionalDSL{}}
|
dsl := &DSL{Optional: OptionalDSL{}, Lang: cfg.Lang}
|
||||||
err = jsoniter.Unmarshal(data, dsl)
|
err = jsoniter.Unmarshal(data, dsl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -362,6 +358,7 @@ func processXgen(process *gou.Process) interface{} {
|
||||||
"name": Setting.Name,
|
"name": Setting.Name,
|
||||||
"description": Setting.Description,
|
"description": Setting.Description,
|
||||||
"theme": Setting.Theme,
|
"theme": Setting.Theme,
|
||||||
|
"lang": Setting.Lang,
|
||||||
"mode": mode,
|
"mode": mode,
|
||||||
"apiPrefix": "__yao",
|
"apiPrefix": "__yao",
|
||||||
"token": "localStorage",
|
"token": "localStorage",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue