diff --git a/CHANGELOG.md b/CHANGELOG.md index 352cc0db5..a468d2f25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Avoid deprecated `defaultProps` for functional components. Refs STCOR-844.. * Update session data with values from `_self` request on reload. Refs STCOR-846. * Avoid deprecated `getChildContext`. Refs STCOR-842. +* Read locale from stripes-config before defaulting to `en-US`. Refs STCOR-851. ## [10.1.0](https://github.com/folio-org/stripes-core/tree/v10.1.0) (2024-03-12) [Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.0.0...v10.1.0) diff --git a/src/components/Root/Root.js b/src/components/Root/Root.js index fc7f3bccf..13e7e47de 100644 --- a/src/components/Root/Root.js +++ b/src/components/Root/Root.js @@ -77,8 +77,9 @@ class Root extends Component { } componentDidMount() { - const { okapi, store, locale, defaultTranslations } = this.props; + const { okapi, store, defaultTranslations } = this.props; if (this.withOkapi) checkOkapiSession(okapi.url, store, okapi.tenant); + const locale = this.props.config.locale ?? 'en-US'; // TODO: remove this after we load locale and translations at start from a public endpoint loadTranslations(store, locale, defaultTranslations); } @@ -114,7 +115,6 @@ class Root extends Component { render() { const { logger, store, epics, config, okapi, actionNames, token, isAuthenticated, disableAuth, currentUser, currentPerms, locale, defaultTranslations, timezone, currency, plugins, bindings, discovery, translations, history, serverDown } = this.props; - if (serverDown) { return