Add Keys for update and error messages

Replaces hardcoded update and error strings in ytsage_dialogs_update.py with internationalized messages. Adds new translation keys for update success, already latest, network error, general error, pip update errors, and pip update failed in all supported languages.
This commit is contained in:
oop7
2025-10-13 15:15:27 +03:00
parent 0530f86a4c
commit 3c8fa38a94
15 changed files with 105 additions and 21 deletions
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ اكتمل تحديث pip بنجاح!", "pip_completed": "✅ اكتمل تحديث pip بنجاح!",
"pip_failed": "❌ فشل تحديث pip: {error}", "pip_failed": "❌ فشل تحديث pip: {error}",
"already_up_to_date": "✅ yt-dlp محدث بالفعل!", "already_up_to_date": "✅ yt-dlp محدث بالفعل!",
"pip_timeout": "❌ انتهت مهلة تحديث pip بعد 5 دقائق" "pip_timeout": "❌ انتهت مهلة تحديث pip بعد 5 دقائق",
"update_success": "✅ تم تحديث yt-dlp بنجاح!",
"already_latest": "yt-dlp محدث (الإصدار {version})",
"network_error": "❌ خطأ في الشبكة أثناء التحديث: {error}",
"general_error": "❌ فشل التحديث: {error}",
"error_pip_update": "❌ خطأ أثناء تحديث pip: {error}",
"pip_update_failed": "❌ فشل تحديث pip: {error}"
}, },
"about": { "about": {
"title": "حول YTSage", "title": "حول YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Pip-Update erfolgreich abgeschlossen!", "pip_completed": "✅ Pip-Update erfolgreich abgeschlossen!",
"pip_failed": "❌ Pip-Update fehlgeschlagen: {error}", "pip_failed": "❌ Pip-Update fehlgeschlagen: {error}",
"already_up_to_date": "✅ yt-dlp ist bereits auf dem neuesten Stand!", "already_up_to_date": "✅ yt-dlp ist bereits auf dem neuesten Stand!",
"pip_timeout": "❌ Pip-Update nach 5 Minuten abgelaufen" "pip_timeout": "❌ Pip-Update nach 5 Minuten abgelaufen",
"update_success": "✅ yt-dlp wurde erfolgreich aktualisiert!",
"already_latest": "yt-dlp ist auf dem neuesten Stand (Version {version})",
"network_error": "❌ Netzwerkfehler während des Updates: {error}",
"general_error": "❌ Update fehlgeschlagen: {error}",
"error_pip_update": "❌ Fehler während des Pip-Updates: {error}",
"pip_update_failed": "❌ Pip-Update fehlgeschlagen: {error}"
}, },
"about": { "about": {
"title": "Über YTSage", "title": "Über YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"running_pip_install": "📦 Running pip install --upgrade...", "running_pip_install": "📦 Running pip install --upgrade...",
"pip_completed": "✅ Pip update completed successfully!", "pip_completed": "✅ Pip update completed successfully!",
"pip_failed": "❌ Pip update failed: {error}", "pip_failed": "❌ Pip update failed: {error}",
"pip_timeout": "❌ Pip update timed out after 5 minutes" "pip_timeout": "❌ Pip update timed out after 5 minutes",
"update_success": "✅ yt-dlp has been successfully updated!",
"already_latest": "yt-dlp is up to date (version {version})",
"network_error": "❌ Network error during update: {error}",
"general_error": "❌ Update failed: {error}",
"error_pip_update": "❌ Error during pip update: {error}",
"pip_update_failed": "❌ Pip update failed: {error}"
}, },
"about": { "about": {
"title": "About YTSage", "title": "About YTSage",
+7 -1
View File
@@ -223,7 +223,13 @@
"running_pip_install": "📦 Ejecutando pip install --upgrade...", "running_pip_install": "📦 Ejecutando pip install --upgrade...",
"pip_completed": "✅ ¡Actualización de pip completada exitosamente!", "pip_completed": "✅ ¡Actualización de pip completada exitosamente!",
"pip_failed": "❌ Actualización de pip falló: {error}", "pip_failed": "❌ Actualización de pip falló: {error}",
"pip_timeout": "❌ Tiempo de espera agotado para actualización de pip después de 5 minutos" "pip_timeout": "❌ Tiempo de espera agotado para actualización de pip después de 5 minutos",
"update_success": "✅ ¡yt-dlp se ha actualizado exitosamente!",
"already_latest": "yt-dlp está actualizado (versión {version})",
"network_error": "❌ Error de red durante la actualización: {error}",
"general_error": "❌ La actualización falló: {error}",
"error_pip_update": "❌ Error durante la actualización de pip: {error}",
"pip_update_failed": "❌ Actualización de pip falló: {error}"
}, },
"settings": { "settings": {
"title": "Configuración de Descarga", "title": "Configuración de Descarga",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Mise à jour pip terminée avec succès !", "pip_completed": "✅ Mise à jour pip terminée avec succès !",
"pip_failed": "❌ Échec de la mise à jour pip : {error}", "pip_failed": "❌ Échec de la mise à jour pip : {error}",
"already_up_to_date": "✅ yt-dlp est déjà à jour !", "already_up_to_date": "✅ yt-dlp est déjà à jour !",
"pip_timeout": "❌ Délai d'attente de mise à jour pip dépassé après 5 minutes" "pip_timeout": "❌ Délai d'attente de mise à jour pip dépassé après 5 minutes",
"update_success": "✅ yt-dlp a été mis à jour avec succès !",
"already_latest": "yt-dlp est à jour (version {version})",
"network_error": "❌ Erreur réseau pendant la mise à jour : {error}",
"general_error": "❌ La mise à jour a échoué : {error}",
"error_pip_update": "❌ Erreur pendant la mise à jour pip : {error}",
"pip_update_failed": "❌ La mise à jour pip a échoué : {error}"
}, },
"about": { "about": {
"title": "À propos de YTSage", "title": "À propos de YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Pip अपडेट सफलतापूर्वक पूर्ण!", "pip_completed": "✅ Pip अपडेट सफलतापूर्वक पूर्ण!",
"pip_failed": "❌ Pip अपडेट असफल: {error}", "pip_failed": "❌ Pip अपडेट असफल: {error}",
"already_up_to_date": "✅ yt-dlp पहले से अप टू डेट है!", "already_up_to_date": "✅ yt-dlp पहले से अप टू डेट है!",
"pip_timeout": "❌ pip अपडेट 5 मिनट के बाद समय समाप्त हो गया" "pip_timeout": "❌ pip अपडेट 5 मिनट के बाद समय समाप्त हो गया",
"update_success": "✅ yt-dlp सफलतापूर्वक अपडेट किया गया है!",
"already_latest": "yt-dlp अप टू डेट है (संस्करण {version})",
"network_error": "❌ अपडेट के दौरान नेटवर्क त्रुटि: {error}",
"general_error": "❌ अपडेट असफल: {error}",
"error_pip_update": "❌ pip अपडेट के दौरान त्रुटि: {error}",
"pip_update_failed": "❌ Pip अपडेट असफल: {error}"
}, },
"about": { "about": {
"title": "YTSage के बारे में", "title": "YTSage के बारे में",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Pembaruan pip berhasil diselesaikan!", "pip_completed": "✅ Pembaruan pip berhasil diselesaikan!",
"pip_failed": "❌ Pembaruan pip gagal: {error}", "pip_failed": "❌ Pembaruan pip gagal: {error}",
"already_up_to_date": "✅ yt-dlp sudah terbaru!", "already_up_to_date": "✅ yt-dlp sudah terbaru!",
"pip_timeout": "❌ Waktu habis untuk pembaruan pip setelah 5 menit" "pip_timeout": "❌ Waktu habis untuk pembaruan pip setelah 5 menit",
"update_success": "✅ yt-dlp telah berhasil diperbarui!",
"already_latest": "yt-dlp sudah terbaru (versi {version})",
"network_error": "❌ Kesalahan jaringan selama pembaruan: {error}",
"general_error": "❌ Pembaruan gagal: {error}",
"error_pip_update": "❌ Kesalahan selama pembaruan pip: {error}",
"pip_update_failed": "❌ Pembaruan pip gagal: {error}"
}, },
"about": { "about": {
"title": "Tentang YTSage", "title": "Tentang YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Aggiornamento pip completato con successo!", "pip_completed": "✅ Aggiornamento pip completato con successo!",
"pip_failed": "❌ Aggiornamento pip fallito: {error}", "pip_failed": "❌ Aggiornamento pip fallito: {error}",
"already_up_to_date": "✅ yt-dlp è già aggiornato!", "already_up_to_date": "✅ yt-dlp è già aggiornato!",
"pip_timeout": "❌ Timeout aggiornamento pip dopo 5 minuti" "pip_timeout": "❌ Timeout aggiornamento pip dopo 5 minuti",
"update_success": "✅ yt-dlp è stato aggiornato con successo!",
"already_latest": "yt-dlp è aggiornato (versione {version})",
"network_error": "❌ Errore di rete durante l'aggiornamento: {error}",
"general_error": "❌ Aggiornamento fallito: {error}",
"error_pip_update": "❌ Errore durante l'aggiornamento pip: {error}",
"pip_update_failed": "❌ Aggiornamento pip fallito: {error}"
}, },
"about": { "about": {
"title": "Informazioni su YTSage", "title": "Informazioni su YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ pipの更新が正常に完了しました!", "pip_completed": "✅ pipの更新が正常に完了しました!",
"pip_failed": "❌ pipの更新に失敗しました: {error}", "pip_failed": "❌ pipの更新に失敗しました: {error}",
"already_up_to_date": "✅ yt-dlpはすでに最新です!", "already_up_to_date": "✅ yt-dlpはすでに最新です!",
"pip_timeout": "❌ pip更新が5分後にタイムアウトしました" "pip_timeout": "❌ pip更新が5分後にタイムアウトしました",
"update_success": "✅ yt-dlpが正常に更新されました!",
"already_latest": "yt-dlpは最新です(バージョン {version}",
"network_error": "❌ 更新中にネットワークエラーが発生しました: {error}",
"general_error": "❌ 更新に失敗しました: {error}",
"error_pip_update": "❌ pipの更新中にエラーが発生しました: {error}",
"pip_update_failed": "❌ pipの更新に失敗しました: {error}"
}, },
"about": { "about": {
"title": "YTSageについて", "title": "YTSageについて",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Aktualizacja pip zakończona pomyślnie!", "pip_completed": "✅ Aktualizacja pip zakończona pomyślnie!",
"pip_failed": "❌ Aktualizacja pip nie powiodła się: {error}", "pip_failed": "❌ Aktualizacja pip nie powiodła się: {error}",
"already_up_to_date": "✅ yt-dlp jest już aktualny!", "already_up_to_date": "✅ yt-dlp jest już aktualny!",
"pip_timeout": "❌ Przekroczono limit czasu aktualizacji pip po 5 minutach" "pip_timeout": "❌ Przekroczono limit czasu aktualizacji pip po 5 minutach",
"update_success": "✅ yt-dlp został pomyślnie zaktualizowany!",
"already_latest": "yt-dlp jest aktualny (wersja {version})",
"network_error": "❌ Błąd sieci podczas aktualizacji: {error}",
"general_error": "❌ Aktualizacja nie powiodła się: {error}",
"error_pip_update": "❌ Błąd podczas aktualizacji pip: {error}",
"pip_update_failed": "❌ Aktualizacja pip nie powiodła się: {error}"
}, },
"about": { "about": {
"title": "O YTSage", "title": "O YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Atualização pip concluída com sucesso!", "pip_completed": "✅ Atualização pip concluída com sucesso!",
"pip_failed": "❌ Atualização pip falhou: {error}", "pip_failed": "❌ Atualização pip falhou: {error}",
"already_up_to_date": "✅ yt-dlp já está atualizado!", "already_up_to_date": "✅ yt-dlp já está atualizado!",
"pip_timeout": "❌ Tempo limite de atualização do pip esgotado após 5 minutos" "pip_timeout": "❌ Tempo limite de atualização do pip esgotado após 5 minutos",
"update_success": "✅ yt-dlp foi atualizado com sucesso!",
"already_latest": "yt-dlp está atualizado (versão {version})",
"network_error": "❌ Erro de rede durante a atualização: {error}",
"general_error": "❌ A atualização falhou: {error}",
"error_pip_update": "❌ Erro durante a atualização do pip: {error}",
"pip_update_failed": "❌ Atualização do pip falhou: {error}"
}, },
"about": { "about": {
"title": "Sobre YTSage", "title": "Sobre YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Обновление pip завершено успешно!", "pip_completed": "✅ Обновление pip завершено успешно!",
"pip_failed": "❌ Обновление pip не удалось: {error}", "pip_failed": "❌ Обновление pip не удалось: {error}",
"already_up_to_date": "✅ yt-dlp уже актуален!", "already_up_to_date": "✅ yt-dlp уже актуален!",
"pip_timeout": "❌ Время ожидания обновления pip истекло через 5 минут" "pip_timeout": "❌ Время ожидания обновления pip истекло через 5 минут",
"update_success": "✅ yt-dlp был успешно обновлен!",
"already_latest": "yt-dlp актуален (версия {version})",
"network_error": "❌ Ошибка сети во время обновления: {error}",
"general_error": "❌ Обновление не удалось: {error}",
"error_pip_update": "❌ Ошибка во время обновления pip: {error}",
"pip_update_failed": "❌ Обновление pip не удалось: {error}"
}, },
"about": { "about": {
"title": "О YTSage", "title": "О YTSage",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ Pip güncellemesi başarıyla tamamlandı!", "pip_completed": "✅ Pip güncellemesi başarıyla tamamlandı!",
"pip_failed": "❌ Pip güncellemesi başarısız: {error}", "pip_failed": "❌ Pip güncellemesi başarısız: {error}",
"already_up_to_date": "✅ yt-dlp zaten güncel!", "already_up_to_date": "✅ yt-dlp zaten güncel!",
"pip_timeout": "❌ pip güncellemesi 5 dakika sonra zaman aşımına uğradı" "pip_timeout": "❌ pip güncellemesi 5 dakika sonra zaman aşımına uğradı",
"update_success": "✅ yt-dlp başarıyla güncellendi!",
"already_latest": "yt-dlp güncel (sürüm {version})",
"network_error": "❌ Güncelleme sırasında ağ hatası: {error}",
"general_error": "❌ Güncelleme başarısız: {error}",
"error_pip_update": "❌ Pip güncellemesi sırasında hata: {error}",
"pip_update_failed": "❌ Pip güncellemesi başarısız: {error}"
}, },
"about": { "about": {
"title": "YTSage Hakkında", "title": "YTSage Hakkında",
+7 -1
View File
@@ -210,7 +210,13 @@
"pip_completed": "✅ pip 更新完成成功!", "pip_completed": "✅ pip 更新完成成功!",
"pip_failed": "❌ pip 更新失败:{error}", "pip_failed": "❌ pip 更新失败:{error}",
"pip_timeout": "❌ pip 更新超时(超过5分钟)", "pip_timeout": "❌ pip 更新超时(超过5分钟)",
"already_up_to_date": "✅ yt-dlp已是最新版本!" "already_up_to_date": "✅ yt-dlp已是最新版本!",
"update_success": "✅ yt-dlp 已成功更新!",
"already_latest": "yt-dlp 是最新版本(版本 {version}",
"network_error": "❌ 更新期间网络错误:{error}",
"general_error": "❌ 更新失败:{error}",
"error_pip_update": "❌ pip 更新期间出错:{error}",
"pip_update_failed": "❌ pip 更新失败:{error}"
}, },
"about": { "about": {
"title": "关于 YTSage", "title": "关于 YTSage",
@@ -132,7 +132,7 @@ class UpdateThread(QThread):
self.update_status.emit(_('update.found_at', path=yt_dlp_path)) self.update_status.emit(_('update.found_at', path=yt_dlp_path))
except Exception as e: except Exception as e:
self.update_status.emit(_('update.error_getting_path', error=e)) self.update_status.emit(_('update.error_getting_path', error=e))
self.update_finished.emit(False, f"❌ Error getting yt-dlp path: {e}") self.update_finished.emit(False, _('update.error_getting_path', error=e))
return return
# Extra logic moved to src\utils\ytsage_constants.py # Extra logic moved to src\utils\ytsage_constants.py
@@ -165,16 +165,16 @@ class UpdateThread(QThread):
if success: if success:
self.update_progress.emit(100) self.update_progress.emit(100)
error_message = "✅ yt-dlp has been successfully updated!" error_message = _('update.update_success')
else: else:
error_message = _('update.update_failed') error_message = _('update.update_failed')
except requests.RequestException as e: except requests.RequestException as e:
error_message = f"❌ Network error during update: {e}" error_message = _('update.network_error', error=e)
self.update_status.emit(error_message) self.update_status.emit(error_message)
success = False success = False
except Exception as e: except Exception as e:
error_message = f"❌ Update failed: {e}" error_message = _('update.general_error', error=e)
self.update_status.emit(error_message) self.update_status.emit(error_message)
success = False success = False
@@ -279,7 +279,7 @@ class UpdateThread(QThread):
self.update_status.emit(_("update.pip_timeout")) self.update_status.emit(_("update.pip_timeout"))
return False return False
except Exception as e: except Exception as e:
self.update_status.emit(f"❌ Error during pip update: {e}") self.update_status.emit(_('update.error_pip_update', error=e))
return False return False
else: else:
self.update_status.emit(_("update.already_up_to_date")) self.update_status.emit(_("update.already_up_to_date"))
@@ -287,7 +287,7 @@ class UpdateThread(QThread):
return True return True
except Exception as e: except Exception as e:
self.update_status.emit(f"❌ Pip update failed: {e}") self.update_status.emit(_('update.pip_update_failed', error=e))
return False return False
@@ -407,7 +407,7 @@ class YTDLPUpdateDialog(QDialog):
) )
self.update_btn.setEnabled(True) self.update_btn.setEnabled(True)
else: else:
self.status_label.setText(f"yt-dlp is up to date (version {current_version})") self.status_label.setText(_('update.already_latest', version=current_version))
self.update_btn.setEnabled(False) self.update_btn.setEnabled(False)
except version.InvalidVersion: except version.InvalidVersion:
# If version parsing fails, do a simple string comparison # If version parsing fails, do a simple string comparison