forked from akai/readest
chore: bump opennext, wrangler and serwist to the latest versions (#2807)
This commit is contained in:
@@ -54,8 +54,8 @@
|
||||
"@aws-sdk/client-s3": "^3.735.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.735.0",
|
||||
"@fabianlars/tauri-plugin-oauth": "2",
|
||||
"@opennextjs/cloudflare": "^1.13.1",
|
||||
"@serwist/next": "^9.3.0",
|
||||
"@opennextjs/cloudflare": "^1.14.7",
|
||||
"@serwist/next": "^9.4.2",
|
||||
"@stripe/react-stripe-js": "^3.7.0",
|
||||
"@stripe/stripe-js": "^7.4.0",
|
||||
"@supabase/auth-ui-react": "^0.4.7",
|
||||
@@ -159,6 +159,6 @@
|
||||
"typescript": "^5.7.2",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^4.0.15",
|
||||
"wrangler": "^4.50.0"
|
||||
"wrangler": "^4.56.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,57 @@
|
||||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import HttpApi from 'i18next-http-backend';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import { options } from '../../i18next-scanner.config';
|
||||
|
||||
i18n
|
||||
.use(HttpApi)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
supportedLngs: ['en', ...options.lngs],
|
||||
fallbackLng: {
|
||||
'zh-HK': ['zh-TW', 'en'],
|
||||
kk: ['ru', 'en'],
|
||||
ky: ['ru', 'en'],
|
||||
tk: ['ru', 'en'],
|
||||
uz: ['ru', 'en'],
|
||||
ug: ['ru', 'en'],
|
||||
tt: ['ru', 'en'],
|
||||
default: ['en'],
|
||||
},
|
||||
ns: options.ns,
|
||||
defaultNS: options.defaultNs,
|
||||
backend: {
|
||||
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
||||
},
|
||||
detection: {
|
||||
order: ['querystring', 'localStorage', 'navigator'],
|
||||
caches: ['localStorage'],
|
||||
},
|
||||
keySeparator: false,
|
||||
nsSeparator: false,
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
react: {
|
||||
useSuspense: false,
|
||||
},
|
||||
});
|
||||
const isBrowser = typeof window !== 'undefined';
|
||||
|
||||
i18n.on('languageChanged', (lng) => {
|
||||
console.log('Language changed to', lng);
|
||||
});
|
||||
const initI18n = async () => {
|
||||
if (isBrowser) {
|
||||
const HttpApi = (await import('i18next-http-backend')).default;
|
||||
i18n.use(HttpApi);
|
||||
}
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
supportedLngs: ['en', ...options.lngs],
|
||||
fallbackLng: {
|
||||
'zh-HK': ['zh-TW', 'en'],
|
||||
kk: ['ru', 'en'],
|
||||
ky: ['ru', 'en'],
|
||||
tk: ['ru', 'en'],
|
||||
uz: ['ru', 'en'],
|
||||
ug: ['ru', 'en'],
|
||||
tt: ['ru', 'en'],
|
||||
default: ['en'],
|
||||
},
|
||||
ns: options.ns,
|
||||
defaultNS: options.defaultNs,
|
||||
...(isBrowser && {
|
||||
backend: {
|
||||
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
||||
},
|
||||
}),
|
||||
detection: {
|
||||
order: ['querystring', 'localStorage', 'navigator'],
|
||||
caches: ['localStorage'],
|
||||
},
|
||||
keySeparator: false,
|
||||
nsSeparator: false,
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
react: {
|
||||
useSuspense: false,
|
||||
},
|
||||
});
|
||||
|
||||
i18n.on('languageChanged', (lng) => {
|
||||
console.log('Language changed to', lng);
|
||||
});
|
||||
};
|
||||
|
||||
initI18n();
|
||||
|
||||
export default i18n;
|
||||
|
||||
Generated
+433
-165
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user