mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
feat: export Trans component
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import i18next, { Resource } from 'i18next';
|
import i18next, { Resource } from 'i18next';
|
||||||
import { initReactI18next, useTranslation } from 'react-i18next';
|
import { Trans, initReactI18next, useTranslation } from 'react-i18next';
|
||||||
import { LOCALES } from './resources/index.js';
|
import { LOCALES } from './resources/index.js';
|
||||||
import type en_US from './resources/en.json';
|
import type en_US from './resources/en.json';
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ declare module 'react-i18next' {
|
|||||||
|
|
||||||
// const STORAGE_KEY = 'i18n_lng';
|
// const STORAGE_KEY = 'i18n_lng';
|
||||||
|
|
||||||
export { i18n, useTranslation, LOCALES };
|
export { Trans, i18n, useTranslation, LOCALES };
|
||||||
|
|
||||||
const resources = LOCALES.reduce<Resource>(
|
const resources = LOCALES.reduce<Resource>(
|
||||||
(acc, { tag, res }) => ({ ...acc, [tag]: { translation: res } }),
|
(acc, { tag, res }) => ({ ...acc, [tag]: { translation: res } }),
|
||||||
|
|||||||
Reference in New Issue
Block a user