summaryrefslogtreecommitdiffstats
path: root/cmd/platform
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-01-08 19:13:24 +0100
committerJoram Wilander <jwawilander@gmail.com>2018-01-08 13:13:24 -0500
commitdd9ad10d705fdbd7fbfa7323e6560b69021a2950 (patch)
tree4064e05fa746abae33fc7c6939fcdef2be7317d2 /cmd/platform
parent591ef9f352efd98a85e6d04c0c9072c4c2987527 (diff)
downloadchat-dd9ad10d705fdbd7fbfa7323e6560b69021a2950.tar.gz
chat-dd9ad10d705fdbd7fbfa7323e6560b69021a2950.tar.bz2
chat-dd9ad10d705fdbd7fbfa7323e6560b69021a2950.zip
[PLT-6936] Translate AppError.Message automatically by default (#8063)
Diffstat (limited to 'cmd/platform')
-rw-r--r--cmd/platform/config.go1
-rw-r--r--cmd/platform/init.go5
-rw-r--r--cmd/platform/server.go6
3 files changed, 12 insertions, 0 deletions
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