mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-30 17:06:34 +08:00
9ea90ca862
* Package only the locale catalogs from server/i18n release.mk copied server/i18n wholesale into the distribution. Everything in that directory today is a catalog, so it made no difference -- but the server loader, mmgotool and the sync test all already filter the directory to *.json, and packaging was the one consumer that did not. Copy the catalogs explicitly so documentation and any other non-catalog file placed alongside them stays out of the release bundle. * Validate the language fallback in display settings user_settings_display reads getLanguageInfo(userLocale).name without a guard, and its container fell back to config.DefaultClientLocale without checking that value resolves. Nothing in the webapp guaranteed it did. In practice it does today: fixInvalidLocales runs on every config load and resets DefaultClientLocale to en when it is not in the supported set, so the dereference cannot currently throw. That invariant lives three layers away in Go, is silent when it fires, and is one refactor from not holding -- and the cost of not depending on it is a two-line fallback. So the container now re-checks the default and drops to General.DEFAULT_LOCALE, matching what getCurrentLocale already does when the current locale is unavailable. Adds index.test.tsx covering the container's locale resolution: a supported user locale is kept, an unsupported one falls back to DefaultClientLocale, and an unsupported DefaultClientLocale -- or one excluded by AvailableLocales -- still resolves to something getLanguageInfo can look up. Two of the four fail without the change.