mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
i18n (#1444)
* adapt not input type * adapt not input type * file i18n * publish i18n * translate * i18n
This commit is contained in:
@@ -6,6 +6,8 @@ type I18nContextType = {
|
||||
commonT: TFunction<['common'], undefined>;
|
||||
appT: TFunction<['app'], undefined>;
|
||||
datasetT: TFunction<['dataset'], undefined>;
|
||||
fileT: TFunction<['file'], undefined>;
|
||||
publishT: TFunction<['publish'], undefined>;
|
||||
};
|
||||
|
||||
export const I18nContext = createContext<I18nContextType>({
|
||||
@@ -17,13 +19,17 @@ const I18nContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
const { t: commonT } = useTranslation('common');
|
||||
const { t: appT } = useTranslation('app');
|
||||
const { t: datasetT } = useTranslation('dataset');
|
||||
const { t: fileT } = useTranslation('file');
|
||||
const { t: publishT } = useTranslation('publish');
|
||||
|
||||
return (
|
||||
<I18nContext.Provider
|
||||
value={{
|
||||
commonT,
|
||||
appT,
|
||||
datasetT
|
||||
datasetT,
|
||||
fileT,
|
||||
publishT
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
Reference in New Issue
Block a user