feat(localization): enhance toast messages for recipes and example images with improved error handling and success feedback

This commit is contained in:
Will Miao
2025-08-31 13:51:37 +08:00
parent e60a579b85
commit 987b8c8742
11 changed files with 134 additions and 65 deletions

View File

@@ -283,13 +283,13 @@ export class DownloadManager {
async proceedToLocation() {
if (!this.currentVersion) {
showToast('Please select a version', 'error');
showToast('toast.loras.pleaseSelectVersion', {}, 'error');
return;
}
const existsLocally = this.currentVersion.existsLocally;
if (existsLocally) {
showToast('This version already exists in your library', 'info');
showToast('toast.loras.versionExists', {}, 'info');
return;
}
@@ -480,7 +480,7 @@ export class DownloadManager {
downloadId
);
showToast('Download completed successfully', 'success');
showToast('toast.loras.downloadCompleted', {}, 'success');
modalManager.closeModal('downloadModal');
ws.close();
@@ -523,11 +523,11 @@ export class DownloadManager {
await this.folderTreeManager.loadTree(treeData.tree);
} else {
console.error('Failed to fetch folder tree:', treeData.error);
showToast('Failed to load folder tree', 'error');
showToast('toast.import.folderTreeFailed', {}, 'error');
}
} catch (error) {
console.error('Error initializing folder tree:', error);
showToast('Error loading folder tree', 'error');
showToast('toast.import.folderTreeError', {}, 'error');
}
}