From dd9ad10d705fdbd7fbfa7323e6560b69021a2950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Mon, 8 Jan 2018 19:13:24 +0100 Subject: [PLT-6936] Translate AppError.Message automatically by default (#8063) --- cmd/platform/config.go | 1 + cmd/platform/init.go | 5 +++++ cmd/platform/server.go | 6 ++++++ 3 files changed, 12 insertions(+) (limited to 'cmd/platform') diff --git a/cmd/platform/config.go b/cmd/platform/config.go index 0b3f26ee0..cd4356529 100644 --- a/cmd/platform/config.go +++ b/cmd/platform/config.go @@ -32,6 +32,7 @@ func init() { func configValidateCmdF(cmd *cobra.Command, args []string) error { utils.TranslationsPreInit() + model.AppErrorInit(utils.T) filePath, err := cmd.Flags().GetString("config") if err != nil { return err diff --git a/cmd/platform/init.go b/cmd/platform/init.go index a25b39383..7d5593821 100644 --- a/cmd/platform/init.go +++ b/cmd/platform/init.go @@ -26,6 +26,11 @@ func initDBCommandContextCobra(cmd *cobra.Command) (*app.App, error) { } func initDBCommandContext(configFileLocation string) (*app.App, error) { + if err := utils.TranslationsPreInit(); err != nil { + return nil, err + } + model.AppErrorInit(utils.T) + if err := utils.InitAndLoadConfig(configFileLocation); err != nil { return nil, err } diff --git a/cmd/platform/server.go b/cmd/platform/server.go index d2abbffb9..e240c6583 100644 --- a/cmd/platform/server.go +++ b/cmd/platform/server.go @@ -42,6 +42,12 @@ func runServerCmd(cmd *cobra.Command, args []string) error { } func runServer(configFileLocation string) { + if err := utils.TranslationsPreInit(); err != nil { + l4g.Exit("Unable to load Mattermost configuration file: ", err) + return + } + model.AppErrorInit(utils.T) + if err := utils.InitAndLoadConfig(configFileLocation); err != nil { l4g.Exit("Unable to load Mattermost configuration file: ", err) return -- cgit v1.2.3-1-g7c22