mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -03:00
feat(localization): enhance toast messages for recipes and example images with improved error handling and success feedback
This commit is contained in:
@@ -142,7 +142,7 @@ class ExampleImagesManager {
|
||||
if (!data.success) {
|
||||
console.error('Failed to update example images path in backend:', data.error);
|
||||
} else {
|
||||
showToast('Example images path updated successfully', 'success');
|
||||
showToast('toast.exampleImages.pathUpdated', {}, 'success');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to update example images path:', error);
|
||||
@@ -187,7 +187,7 @@ class ExampleImagesManager {
|
||||
this.startDownload();
|
||||
} else {
|
||||
// If download is in progress, show info toast
|
||||
showToast('Download already in progress', 'info');
|
||||
showToast('toast.exampleImages.downloadInProgress', {}, 'info');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ class ExampleImagesManager {
|
||||
|
||||
async startDownload() {
|
||||
if (this.isDownloading) {
|
||||
showToast('Download already in progress', 'warning');
|
||||
showToast('toast.exampleImages.downloadInProgress', {}, 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class ExampleImagesManager {
|
||||
const outputDir = document.getElementById('exampleImagesPath').value || '';
|
||||
|
||||
if (!outputDir) {
|
||||
showToast('Please enter a download location first', 'warning');
|
||||
showToast('toast.exampleImages.enterLocationFirst', {}, 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ class ExampleImagesManager {
|
||||
this.showProgressPanel();
|
||||
this.startProgressUpdates();
|
||||
this.updateDownloadButtonText();
|
||||
showToast('Example images download started', 'success');
|
||||
showToast('toast.exampleImages.downloadStarted', {}, 'success');
|
||||
|
||||
// Close settings modal
|
||||
modalManager.closeModal('settingsModal');
|
||||
@@ -289,7 +289,7 @@ class ExampleImagesManager {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to start download:', error);
|
||||
showToast('Failed to start download', 'error');
|
||||
showToast('toast.exampleImages.downloadStartFailed', {}, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,13 +319,13 @@ class ExampleImagesManager {
|
||||
}
|
||||
|
||||
this.updateDownloadButtonText();
|
||||
showToast('Download paused', 'info');
|
||||
showToast('toast.exampleImages.downloadPaused', {}, 'info');
|
||||
} else {
|
||||
showToast(data.error || 'Failed to pause download', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to pause download:', error);
|
||||
showToast('Failed to pause download', 'error');
|
||||
showToast('toast.exampleImages.pauseFailed', {}, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,13 +355,13 @@ class ExampleImagesManager {
|
||||
}
|
||||
|
||||
this.updateDownloadButtonText();
|
||||
showToast('Download resumed', 'success');
|
||||
showToast('toast.exampleImages.downloadResumed', {}, 'success');
|
||||
} else {
|
||||
showToast(data.error || 'Failed to resume download', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to resume download:', error);
|
||||
showToast('Failed to resume download', 'error');
|
||||
showToast('toast.exampleImages.resumeFailed', {}, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user