[PLT-6936] Translate AppError.Message automatically by default (#8063)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
591ef9f352
Коммит
dd9ad10d70
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user