feat: add server default locale setting (#1536)

* feat: add server default locale setting

* fix: do not modify defaultLocale property of IntlProvider
This commit is contained in:
TheCatLady
2021-05-03 09:11:28 -04:00
committed by GitHub
parent 4fd452dd18
commit f256a444c5
14 changed files with 94 additions and 44 deletions

View File

@@ -119,7 +119,7 @@ const CoreApp: Omit<NextAppComponentType, 'origGetInitialProps'> = ({
<InteractionProvider>
<ToastProvider components={{ Toast, ToastContainer }}>
<Head>
<title>Overseerr</title>
<title>{currentSettings.applicationTitle}</title>
<meta
name="viewport"
content="initial-scale=1, viewport-fit=cover, width=device-width"
@@ -156,6 +156,7 @@ CoreApp.getInitialProps = async (initialProps) => {
cacheImages: false,
vapidPublic: '',
enablePushRegistration: false,
locale: 'en',
};
if (ctx.res) {
@@ -209,7 +210,9 @@ CoreApp.getInitialProps = async (initialProps) => {
initialProps
);
const locale = user?.settings?.locale ?? 'en';
const locale = user?.settings?.locale
? user.settings.locale
: currentSettings.locale;
const messages = await loadLocaleData(locale as AvailableLocales);