Extracting i18n functionality to i18n core library (#16914)
* extracting i18n functionality to i18n core library * Removing utils.T * Adding documentation and changing one function name for better explanation * Changing other missing utils.T * Adding license string * Renaming corelibs to pkg * Renaming corelibs to pkg (moving directory) * Renaming from pkg to shared * Fixing bodyPage.Html casing * Fixing merges * Fixing merge problem * Fixing tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
85293fcf41
Коммит
5dd2e75c10
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
)
|
||||
|
||||
@@ -110,7 +111,7 @@ func fixConfig(cfg *model.Config) {
|
||||
func FixInvalidLocales(cfg *model.Config) bool {
|
||||
var changed bool
|
||||
|
||||
locales := utils.GetSupportedLocales()
|
||||
locales := i18n.GetSupportedLocales()
|
||||
if _, ok := locales[*cfg.LocalizationSettings.DefaultServerLocale]; !ok {
|
||||
*cfg.LocalizationSettings.DefaultServerLocale = model.DEFAULT_LOCALE
|
||||
mlog.Warn("DefaultServerLocale must be one of the supported locales. Setting DefaultServerLocale to en as default value.")
|
||||
|
||||
Ссылка в новой задаче
Block a user