mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 05:19:51 +00:00
feat: optimize i18n implementation for better localization (#2062)
* feat: optimize i18n implementation for better localization * delete i18n-ally-custom-framework.yml * update common key
This commit is contained in:
@@ -712,29 +712,29 @@ export const getSystemVariables = (t: TFunction): EditorVariablePickerType[] =>
|
||||
return [
|
||||
{
|
||||
key: 'appId',
|
||||
label: t('core.module.http.AppId'),
|
||||
label: t('common:core.module.http.AppId'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
key: 'chatId',
|
||||
label: t('core.module.http.ChatId'),
|
||||
label: t('common:core.module.http.ChatId'),
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
key: 'responseChatItemId',
|
||||
label: t('core.module.http.ResponseChatItemId'),
|
||||
label: t('common:core.module.http.ResponseChatItemId'),
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
key: 'histories',
|
||||
label: t('core.module.http.Histories'),
|
||||
label: t('common:core.module.http.Histories'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.chatHistory
|
||||
},
|
||||
{
|
||||
key: 'cTime',
|
||||
label: t('core.module.http.Current time'),
|
||||
label: t('common:core.module.http.Current time'),
|
||||
required: true,
|
||||
valueType: WorkflowIOValueTypeEnum.string
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ const SelectCollections = ({
|
||||
|
||||
return null;
|
||||
},
|
||||
errorToast: t('common.Request Error')
|
||||
errorToast: t('common:common.Request Error')
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -122,8 +122,8 @@ const SelectCollections = ({
|
||||
{title
|
||||
? title
|
||||
: type === 'folder'
|
||||
? t('common.Root folder')
|
||||
: t('dataset.collections.Select Collection')}
|
||||
? t('common:common.Root folder')
|
||||
: t('common:dataset.collections.Select Collection')}
|
||||
</Box>
|
||||
{!!tip && (
|
||||
<Box fontSize={'sm'} color={'myGray.500'}>
|
||||
@@ -194,7 +194,7 @@ const SelectCollections = ({
|
||||
)}
|
||||
</Grid>
|
||||
{collections.length === 0 && (
|
||||
<EmptyTip pt={'20vh'} text={t('common.folder.No Folder')}></EmptyTip>
|
||||
<EmptyTip pt={'20vh'} text={t('common:common.folder.No Folder')}></EmptyTip>
|
||||
)}
|
||||
<Loading loading={isLoading} fixed={false} />
|
||||
</ModalBody>
|
||||
@@ -207,7 +207,7 @@ const SelectCollections = ({
|
||||
isDisabled={type === 'collection' && selectedDatasetCollectionIds.length === 0}
|
||||
onClick={mutate}
|
||||
>
|
||||
{type === 'folder' ? t('common.Confirm Move') : t('common.Confirm')}
|
||||
{type === 'folder' ? t('common:common.Confirm Move') : t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
)}
|
||||
|
@@ -102,32 +102,32 @@ export const DatasetPageContextProvider = ({
|
||||
if (vectorTrainingCount < 1000)
|
||||
return {
|
||||
colorSchema: 'green',
|
||||
tip: t('core.dataset.training.Leisure')
|
||||
tip: t('common:core.dataset.training.Leisure')
|
||||
};
|
||||
if (vectorTrainingCount < 10000)
|
||||
return {
|
||||
colorSchema: 'yellow',
|
||||
tip: t('core.dataset.training.Waiting')
|
||||
tip: t('common:core.dataset.training.Waiting')
|
||||
};
|
||||
return {
|
||||
colorSchema: 'red',
|
||||
tip: t('core.dataset.training.Full')
|
||||
tip: t('common:core.dataset.training.Full')
|
||||
};
|
||||
})();
|
||||
const agentTrainingMap = (() => {
|
||||
if (agentTrainingCount < 100)
|
||||
return {
|
||||
colorSchema: 'green',
|
||||
tip: t('core.dataset.training.Leisure')
|
||||
tip: t('common:core.dataset.training.Leisure')
|
||||
};
|
||||
if (agentTrainingCount < 1000)
|
||||
return {
|
||||
colorSchema: 'yellow',
|
||||
tip: t('core.dataset.training.Waiting')
|
||||
tip: t('common:core.dataset.training.Waiting')
|
||||
};
|
||||
return {
|
||||
colorSchema: 'red',
|
||||
tip: t('core.dataset.training.Full')
|
||||
tip: t('common:core.dataset.training.Full')
|
||||
};
|
||||
})();
|
||||
return {
|
||||
|
@@ -25,7 +25,7 @@ export function getCollectionSourceAndOpen(collectionId: string) {
|
||||
}
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: getErrText(error, t('error.fileNotFound')),
|
||||
title: getErrText(error, t('common:error.fileNotFound')),
|
||||
status: 'error'
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user