chore: bump opennext, wrangler and serwist to the latest versions (#2807)

This commit is contained in:
Huang Xin
2025-12-29 05:12:32 +01:00
committed by GitHub
parent 11fecb5dc0
commit d53fc09e1e
3 changed files with 486 additions and 207 deletions
+3 -3
View File
@@ -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"
}
}
+50 -39
View File
@@ -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;
+433 -165
View File
File diff suppressed because it is too large Load Diff