[MM-14361] Initialise the translations before loading the config store (#10435)

Этот коммит содержится в:
Miguel de la Cruz
2019-03-12 17:50:48 +00:00
коммит произвёл GitHub
родитель ca52ca7016
Коммит 434d01a284
3 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@@ -21,9 +21,13 @@ var TDefault i18n.TranslateFunc
var locales map[string]string = make(map[string]string)
var settings model.LocalizationSettings
// this functions loads translations from filesystem
// and assign english while loading server config
// this functions loads translations from filesystem if they are not
// loaded already and assigns english while loading server config
func TranslationsPreInit() error {
if T != nil {
return nil
}
// Set T even if we fail to load the translations. Lots of shutdown handling code will
// segfault trying to handle the error, and the untranslated IDs are strictly better.
T = TfuncWithFallback("en")