mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat: upgrade dependencies and lockfile (#5016)
- Close https://github.com/toeverything/AFFiNE/security/dependabot/47
This commit is contained in:
@@ -2,6 +2,7 @@ import type { i18n, Resource } from 'i18next';
|
||||
import i18next from 'i18next';
|
||||
import {
|
||||
I18nextProvider,
|
||||
type I18nextProviderProps,
|
||||
initReactI18next,
|
||||
Trans,
|
||||
useTranslation as useRootTranslation,
|
||||
@@ -66,8 +67,9 @@ const standardizeLocale = (language: string) => {
|
||||
return fallbackLng;
|
||||
};
|
||||
|
||||
export const createI18n = () => {
|
||||
const i18n = i18next.createInstance();
|
||||
export const createI18n = (): I18nextProviderProps['i18n'] => {
|
||||
// @ts-expect-error ts bug
|
||||
const i18n: I18nextProviderProps['i18n'] = i18next.createInstance();
|
||||
i18n
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { Request } from 'undici-types';
|
||||
|
||||
// cSpell:ignore Tolgee
|
||||
const TOLGEE_API_KEY = process.env['TOLGEE_API_KEY'];
|
||||
const TOLGEE_API_URL = 'https://i18n.affine.pro';
|
||||
@@ -15,7 +17,7 @@ const withTolgee = (
|
||||
'Content-Type': 'application/json',
|
||||
});
|
||||
|
||||
const isRequest = (input: RequestInfo | URL): input is Request => {
|
||||
const isRequest = (input: NodeJS.fetch.RequestInfo): input is Request => {
|
||||
return typeof input === 'object' && !('href' in input);
|
||||
};
|
||||
|
||||
@@ -31,6 +33,7 @@ const withTolgee = (
|
||||
argArray[0] = {
|
||||
...argArray[0],
|
||||
url: `${baseUrl}${argArray[0].url}`,
|
||||
// @ts-expect-error Node.js types incorrectly define RequestInit
|
||||
headers,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user