We're updating the issue view to help you get more done.Learn more

Default Server/Client Locales reverted to `en` on server startup.

Steps to Reproduce

1. Run v5.8 or later
2. Using the system console (or editing config.json directly), configure a valid DefaultServerLocale or DefaultClientLocale other than "en"
3. Restart the server

Expected

1. DefaultServerLocale or DefaultClientLocale preserved, if valid

Observed

1. DefaultServerLocale or DefaultClientLocale reverted to "en". In master, this is accompanied by an explicit log:

1 2 {"level":"warn","msg":"DefaultServerLocale must be one of the supported locales. Setting DefaultServerLocale to en as default value."} {"level":"warn","msg":"DefaultClientLocale must be one of the supported locales. Setting DefaultClientLocale to en as default value."}

Notes

The cause appears to be that we now invoke utils.TranslationsPreInit /after/ initializing the config (I think this happened with the app struct rework). But the config subsystem uses the i18n locales to decide if the config is valid.

Status

Assignee

Miguel de la Cruz

Reporter

Jesse Hallam

Fix versions

Mattermost Team

Platform

Sprint

None

Labels

QA Assignee

Jesse Hallam

QA Test Steps

1. With the server down, set an invalid locale in the DefaultServerLocale and DefaultClientLocale in config.json. E.g.: "asdf" 2. Start the server 3. After the initialisation, both fields in the config file should have been reverted to "en" 4. With the server down, set both fields to a valid locale different than "en". E.g.: "de" 5. Start the server 6. After the initialisation, both fields should remain set to the valid locale instead of reverted to the default "en"

QA Testing Areas

Other (write in QA test steps)