feat(localization): update toast messages for improved user feedback and localization support across various components

This commit is contained in:
Will Miao
2025-08-31 16:52:58 +08:00
parent b2428f607c
commit 7bef562541
12 changed files with 68 additions and 95 deletions

View File

@@ -343,7 +343,7 @@ export class DownloadManager {
this.updateTargetPath();
} catch (error) {
showToast('downloads.loadError', { message: error.message }, 'error');
showToast('toast.downloads.loadError', { message: error.message }, 'error');
}
}
@@ -418,7 +418,7 @@ export class DownloadManager {
const config = this.apiClient.apiConfig.config;
if (!modelRoot) {
showToast(`Please select a ${config.displayName} root directory`, 'error');
showToast('models.pleaseSelectRoot', { type: config.displayName }, 'error');
return;
}
@@ -507,7 +507,7 @@ export class DownloadManager {
await resetAndReload(true);
} catch (error) {
showToast('downloads.downloadError', { message: error.message }, 'error');
showToast('toast.downloads.downloadError', { message: error.message }, 'error');
} finally {
this.loadingManager.hide();
}

View File

@@ -399,7 +399,7 @@ class ExampleImagesManager {
if (data.status.status === 'completed' && !this.hasShownCompletionToast) {
const actionType = this.isMigrating ? 'migration' : 'download';
showToast(`Example images ${actionType} completed`, 'success');
showToast('toast.downloads.imagesCompleted', { action: actionType }, 'success');
// Mark as shown to prevent duplicate toasts
this.hasShownCompletionToast = true;
// Reset migration flag
@@ -408,7 +408,7 @@ class ExampleImagesManager {
setTimeout(() => this.hideProgressPanel(), 5000);
} else if (data.status.status === 'error') {
const actionType = this.isMigrating ? 'migration' : 'download';
showToast(`Example images ${actionType} failed`, 'error');
showToast('toast.downloads.imagesFailed', { action: actionType }, 'error');
this.isMigrating = false;
}
}