mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
feat(i18n): static type on i18n (#2225)
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
I18nextProvider,
|
||||
initReactI18next,
|
||||
Trans,
|
||||
useTranslation,
|
||||
useTranslation as useRootTranslation,
|
||||
} from 'react-i18next';
|
||||
|
||||
import { LOCALES } from './resources';
|
||||
@@ -38,7 +38,11 @@ declare module 'react-i18next' {
|
||||
|
||||
const STORAGE_KEY = 'i18n_lng';
|
||||
|
||||
export { I18nextProvider, LOCALES, Trans, useTranslation };
|
||||
export { I18nextProvider, LOCALES, Trans };
|
||||
export function useI18N() {
|
||||
const { i18n } = useRootTranslation();
|
||||
return i18n;
|
||||
}
|
||||
|
||||
const resources = LOCALES.reduce<Resource>(
|
||||
(acc, { tag, res }) => ({ ...acc, [tag]: { translation: res } }),
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
"It takes up more space on your device": {
|
||||
"": "It takes up more space on your device."
|
||||
},
|
||||
"Synced with AFFiNE Cloud": "Synced with AFFiNE Cloud",
|
||||
"Successfully deleted": "Successfully deleted",
|
||||
"Export AFFiNE backup file": "Export AFFiNE backup file",
|
||||
"Saved then enable AFFiNE Cloud": "All changes are saved locally, click to enable AFFiNE Cloud.",
|
||||
"Not now": "Not now",
|
||||
@@ -95,6 +97,7 @@
|
||||
"Quick search placeholder": "Quick Search...",
|
||||
"Quick search placeholder2": "Search in {{workspace}}",
|
||||
"Settings": "Settings",
|
||||
"Recent": "Recent",
|
||||
"recommendBrowser": " We recommend the <1>Chrome</1> browser for optimal experience.",
|
||||
"upgradeBrowser": "Please upgrade to the latest version of Chrome for the best experience.",
|
||||
"Invite Members": "Invite Members",
|
||||
|
||||
Reference in New Issue
Block a user