mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 20:28:40 -05:00
feat(lang): add support for Chinese (Traditional) language
This commit is contained in:
@@ -18,7 +18,7 @@ import { PublicSettingsResponse } from '../../server/interfaces/api/settingsInte
|
||||
import { SettingsProvider } from '../context/SettingsContext';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const loadLocaleData = (locale: string): Promise<any> => {
|
||||
const loadLocaleData = (locale: AvailableLocales): Promise<any> => {
|
||||
switch (locale) {
|
||||
case 'ja':
|
||||
return import('../i18n/locale/ja.json');
|
||||
@@ -42,6 +42,8 @@ const loadLocaleData = (locale: string): Promise<any> => {
|
||||
return import('../i18n/locale/sr.json');
|
||||
case 'sv':
|
||||
return import('../i18n/locale/sv.json');
|
||||
case 'zh-Hant':
|
||||
return import('../i18n/locale/zh_Hant.json');
|
||||
default:
|
||||
return import('../i18n/locale/en.json');
|
||||
}
|
||||
@@ -112,6 +114,10 @@ const CoreApp: Omit<NextAppComponentType, 'origGetInitialProps'> = ({
|
||||
<ToastProvider components={{ Toast }}>
|
||||
<Head>
|
||||
<title>Overseerr</title>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1"
|
||||
/>
|
||||
</Head>
|
||||
<StatusChecker />
|
||||
<UserContext initialUser={user}>{component}</UserContext>
|
||||
@@ -192,7 +198,7 @@ CoreApp.getInitialProps = async (initialProps) => {
|
||||
initialProps
|
||||
);
|
||||
|
||||
const messages = await loadLocaleData(locale);
|
||||
const messages = await loadLocaleData(locale as AvailableLocales);
|
||||
|
||||
return { ...appInitialProps, user, messages, locale, currentSettings };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user