i18n notifications and details

This commit is contained in:
josc146
2023-05-18 21:19:13 +08:00
parent 5078a884b0
commit 934f7b15e8
7 changed files with 32 additions and 16 deletions

View File

@@ -64,7 +64,7 @@ export const Configs: FC = observer(() => {
presence_penalty: selectedConfig.apiParameters.presencePenalty,
frequency_penalty: selectedConfig.apiParameters.frequencyPenalty
});
toast('Config Saved', {autoClose: 300, type: 'success'});
toast(t('Config Saved'), {autoClose: 300, type: 'success'});
};
return (
@@ -182,12 +182,12 @@ export const Configs: FC = observer(() => {
const modelPath = `${manifest.localModelDir}/${selectedConfig.modelParameters.modelName}`;
const strategy = getStrategy(selectedConfig);
const newModelPath = modelPath + '-' + strategy.replace(/[> *+]/g, '-');
toast('Start Converting', {autoClose: 1000, type: 'info'});
toast(t('Start Converting'), {autoClose: 1000, type: 'info'});
ConvertModel(modelPath, strategy, newModelPath).then(() => {
toast(`Convert Success - ${newModelPath}`, {type: 'success'});
toast(`${t('Convert Success')} - ${newModelPath}`, {type: 'success'});
refreshLocalModels({models: commonStore.modelSourceList});
}).catch(e => {
toast(`Convert Failed - ${e}`, {type: 'error'});
toast(`${t('Convert Failed')} - ${e}`, {type: 'error'});
});
}}/>
<Labeled label={t('Device')} content={

View File

@@ -129,7 +129,7 @@ const columns: TableColumnDefinition<ModelSourceItem>[] = [
}
{item.downloadUrl && !item.isLocal &&
<ToolTipButton desc={t('Download')} icon={<ArrowDownload20Regular/>} onClick={() => {
toast(`Downloading ${item.name}`);
toast(`${t('Downloading')} ${item.name}`);
DownloadFile(`./${manifest.localModelDir}/${item.name}`, item.downloadUrl!);
}}/>}
{item.url && <ToolTipButton desc={t('Open Url')} icon={<Open20Regular/>} onClick={() => {