diff --git a/app/gabsocial/actions/settings.js b/app/gabsocial/actions/settings.js index 775756f84..df6c68f6d 100644 --- a/app/gabsocial/actions/settings.js +++ b/app/gabsocial/actions/settings.js @@ -21,6 +21,8 @@ const defaultSettings = ImmutableMap({ deleteModal: true, defaultPrivacy: 'public', theme: 'lime', + // locale: navigator.language.slice(0, 2) || 'en', // FIXME: Dynamic locales + locale: 'en', systemFont: false, dyslexicFont: false, diff --git a/app/gabsocial/containers/gabsocial.js b/app/gabsocial/containers/gabsocial.js index 7c383fe7f..556f50bca 100644 --- a/app/gabsocial/containers/gabsocial.js +++ b/app/gabsocial/containers/gabsocial.js @@ -24,9 +24,6 @@ import { fetchMe } from 'gabsocial/actions/me'; import PublicLayout from 'gabsocial/features/public_layout'; import { getSettings } from 'gabsocial/actions/settings'; -const { localeData, messages } = getLocale(); -addLocaleData(localeData); - export const store = configureStore(); const hydrateAction = hydrateStore(initialState); @@ -50,6 +47,7 @@ const mapStateToProps = (state) => { systemFont: settings.get('systemFont'), dyslexicFont: settings.get('dyslexicFont'), demetricator: settings.get('demetricator'), + locale: settings.get('locale'), }; }; @@ -64,12 +62,16 @@ class GabSocialMount extends React.PureComponent { systemFont: PropTypes.bool, dyslexicFont: PropTypes.bool, demetricator: PropTypes.bool, + locale: PropTypes.string.isRequired, }; render() { - const { me, theme, reduceMotion, systemFont, dyslexicFont, demetricator } = this.props; + const { me, theme, reduceMotion, systemFont, dyslexicFont, demetricator, locale } = this.props; if (me === null) return null; + const { localeData, messages } = getLocale(); + addLocaleData(localeData); + // Disabling introduction for launch // const { showIntroduction } = this.props; // @@ -86,21 +88,24 @@ class GabSocialMount extends React.PureComponent { }); return ( - <> - - - {theme && } - - - - - {!me && } - - - - - - + + <> + + + - + -
+