diff --git a/cmd/migrate.go b/cmd/migrate.go index 39958cb7..ab7987eb 100644 --- a/cmd/migrate.go +++ b/cmd/migrate.go @@ -21,7 +21,7 @@ var migrateCmd = &cobra.Command{ // 加载数据模型 err := engine.Load(config.Conf) if err != nil { - fmt.Printf(color.RedString("加载失败: %s\n", err.Error())) + fmt.Println(color.RedString(L("Fatal: %s"), err.Error())) os.Exit(1) } @@ -35,12 +35,12 @@ var migrateCmd = &cobra.Command{ // Do Stuff Here for _, mod := range gou.Models { - fmt.Println(color.GreenString("更新数据模型 %s 绑定数据表: %s", mod.Name, mod.MetaData.Table.Name)) + fmt.Println(color.GreenString(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name)) mod.Migrate(true) } }, } func init() { - migrateCmd.PersistentFlags().StringVarP(&name, "name", "n", "", "指定模型名称") + migrateCmd.PersistentFlags().StringVarP(&name, "name", "n", "", L("Model name")) } diff --git a/cmd/root.go b/cmd/root.go index 4b68bce2..849085d5 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -37,6 +37,8 @@ var langs = map[string]string{ "Run: %s": "运行: %s", "Arguments: %s": "参数错误: %s", "%s Response": "%s 返回结果", + "Update schema model: %s (%s) ": "更新表结构 model: %s (%s)", + "Model name": "模型名称", } // L 多语言切换 diff --git a/cmd/start.go b/cmd/start.go index b448e503..2ffc48e1 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -33,7 +33,7 @@ var startCmd = &cobra.Command{ mode := config.Conf.Mode err := engine.Load(config.Conf) // 加载脚本等 if err != nil { - fmt.Printf(color.RedString(L("Fatal: %s"), err.Error())) + fmt.Println(color.RedString(L("Fatal: %s"), err.Error())) os.Exit(1) } port := fmt.Sprintf(":%d", config.Conf.Port)