From a82c063fb997ef45fa12ecbd8945ea7acc528785 Mon Sep 17 00:00:00 2001 From: lx-s Date: Sun, 10 Dec 2023 19:25:56 +0100 Subject: [PATCH] Translated the some error messages. --- Translations/wm_de/resource.h | 6 ++++++ Translations/wm_de/wm_de.rc | Bin 25416 -> 26962 bytes WinMute/Settings_QuietHoursDlg.cpp | 12 +++++++----- WinMute/VistaAudioSessionEvents.cpp | 9 +++++---- WinMute/WinMute.rc | 11 +++++++++++ WinMute/resource.h | 6 ++++++ 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Translations/wm_de/resource.h b/Translations/wm_de/resource.h index 43789a1..01a016b 100644 --- a/Translations/wm_de/resource.h +++ b/Translations/wm_de/resource.h @@ -10,6 +10,8 @@ #define IDS_MAIN_ERROR_INIT_WINMUTE_TITLE 106 #define IDS_MAIN_ERROR_INIT_WINMUTE_TEXT 107 #define IDS_MAIN_ERROR_WINAPI_FAILURE_TEXT 108 +#define IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TITLE 109 +#define IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TEXT 110 #define IDS_WM_ERROR_WINDOWS_SUPPORT_TITLE 201 #define IDS_WM_ERROR_WINDOWS_SUPPORT_TEXT2 202 #define IDS_WM_ERROR_WINDOWS_SUPPORT_TEXT 202 @@ -102,6 +104,10 @@ #define IDS_SETTINGS_QUIETHOURS_FORCE_UNMUTE 1304 #define IDS_SETTINGS_QUIETHOURS_FORCE_UNMUTE_DESCRIPTION 1305 #define IDS_SETTINGS_QUIETHOURS_SHOW_NOTIFICATIONS 1306 +#define IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TITLE 1307 +#define IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TEXT 1308 +#define IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TITLE 1309 +#define IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TEXT 1310 #define IDS_SETTINGS_WIFI_INTRO 1400 #define IDS_SETTINGS_WIFI_ENABLE 1401 #define IDS_SETTINGS_WIFI_MUTE_WHEN_NOT_IN_LIST 1402 diff --git a/Translations/wm_de/wm_de.rc b/Translations/wm_de/wm_de.rc index c58cbba2bd0b93919e7a68cf545a2965fb2530f9..97f8bf80bfcac83d1eb1fc4d834e82ee4d255c05 100644 GIT binary patch delta 762 zcmb7CO)o=H5It6e#i=}^HGl``iU`1@K z#7ZnA!rH=L=-$Ga`>>G+n|tTZnK?6O?mXO=y}XoNo>j|Dpu0DMB}6fU1lF;D7*bf~ zYl4=(r-?2SPautXsR_r2qj2ECLIj7%Ad7tzjOU2<7A*_ML_A_@Z}N1IM@FvdLvmLU z{8zo_P+T5Y0w)%BVUs0KMw{#f-dfxFtZlK=EQ&;Ip4yW}y2QQj_`K=QC9c^yVy@Al zS$Xu+H*PqJL@dS>nd$Ll_qE2M<+QAgg4CrO$}OfjIF!;z;`+6EV^q$E+T|_Q5?}YiX!m}vIVtt_{DH?FOxO-~nCZ_&RbCeP4w+bkiNU<+hKY@QdiMGOG0;0wP1 diff --git a/WinMute/Settings_QuietHoursDlg.cpp b/WinMute/Settings_QuietHoursDlg.cpp index 4223b38..84e7403 100644 --- a/WinMute/Settings_QuietHoursDlg.cpp +++ b/WinMute/Settings_QuietHoursDlg.cpp @@ -56,13 +56,13 @@ static bool SaveQuietHours( { if (enabled) { if (!IsValidTimeRange(start, end)) { + WMi18n &i18n = WMi18n::GetInstance(); TaskDialog( nullptr, nullptr, PROGRAM_NAME, - L"Invalid time range", - L"Can't start and stop at the same time.\n" - L"Please correct your time range.\n", + i18n.GetTextW(IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TITLE).c_str(), + i18n.GetTextW(IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TEXT).c_str(), TDCBF_OK_BUTTON, TD_WARNING_ICON, nullptr); @@ -78,12 +78,14 @@ static bool SaveQuietHours( || !settings->SetValue(SettingsKey::QUIETHOURS_NOTIFICATIONS, showNotifications) || !settings->SetValue(SettingsKey::QUIETHOURS_START, setStart) || !settings->SetValue(SettingsKey::QUIETHOURS_END, setEnd)) { + WMi18n &i18n = WMi18n::GetInstance(); + TaskDialog( nullptr, nullptr, PROGRAM_NAME, - L"Failed to save quiet hours settings", - L"Something went wrong while saving your settings.", + i18n.GetTextW(IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TITLE).c_str(), + i18n.GetTextW(IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TEXT).c_str(), TDCBF_OK_BUTTON, TD_ERROR_ICON, nullptr); diff --git a/WinMute/VistaAudioSessionEvents.cpp b/WinMute/VistaAudioSessionEvents.cpp index 7b876bc..1cc3136 100644 --- a/WinMute/VistaAudioSessionEvents.cpp +++ b/WinMute/VistaAudioSessionEvents.cpp @@ -125,17 +125,18 @@ HRESULT STDMETHODCALLTYPE VistaAudioSessionEvents::OnSessionDisconnected( case DisconnectReasonSessionDisconnected: notifyParent_->ShouldReInit(); break; - case DisconnectReasonServerShutdown: + case DisconnectReasonServerShutdown: { + WMi18n &i18n = WMi18n::GetInstance(); TaskDialog(nullptr, nullptr, PROGRAM_NAME, - L"The audio service has been shut down. ", - L"WinMute is not able to recover from that condition.\n" - L"Please try restarting the program", + i18n.GetTextW(IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TITLE).c_str(), + i18n.GetTextW(IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TEXT).c_str(), TDCBF_OK_BUTTON, TD_WARNING_ICON, nullptr); break; + } case DisconnectReasonSessionLogoff: break; case DisconnectReasonExclusiveModeOverride: diff --git a/WinMute/WinMute.rc b/WinMute/WinMute.rc index d7bb9bf..1727629 100644 --- a/WinMute/WinMute.rc +++ b/WinMute/WinMute.rc @@ -551,6 +551,10 @@ BEGIN IDS_MAIN_ERROR_INIT_WINMUTE_TEXT "WinMute encountered a critical error while initializing and must shut down." IDS_MAIN_ERROR_WINAPI_FAILURE_TEXT "{} failed with error {}: {}" + IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TITLE + "The audio service has been shut down." + IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TEXT + "WinMute is not able to recover from that condition.\nPlease try to restart the program." END STRINGTABLE @@ -710,6 +714,13 @@ BEGIN "If force unmute is enabled, WinMute will unmute your audio endpoints when quiet hours and and not take into account if they were already muted before quiet hours started." IDS_SETTINGS_QUIETHOURS_SHOW_NOTIFICATIONS "Show Quiet Hours notifications" + IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TITLE "Invalid time range" + IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TEXT + "Can't start and stop at the same time.\nPlease correct your time range." + IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TITLE + "Failed to save quiet hours settings" + IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TEXT + "Something went wrong while saving your settings" END STRINGTABLE diff --git a/WinMute/resource.h b/WinMute/resource.h index 7fb7188..0f98c29 100644 --- a/WinMute/resource.h +++ b/WinMute/resource.h @@ -16,6 +16,8 @@ #define IDS_MAIN_ERROR_INIT_WINMUTE_TEXT 107 #define IDS_MAIN_ERROR_WINAPI_FAILURE_TEXT 108 #define IDD_SETTINGS 109 +#define IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TITLE 109 +#define IDS_MAIN_ERROR_AUDIO_SERVICE_SHUTDOWN_TEXT 110 #define IDD_SETTINGS_GENERAL 114 #define IDD_SETTINGS_QUIETHOURS 116 #define IDD_ABOUT_LICENSE 118 @@ -202,6 +204,10 @@ #define IDS_SETTINGS_QUIETHOURS_FORCE_UNMUTE 1304 #define IDS_SETTINGS_QUIETHOURS_FORCE_UNMUTE_DESCRIPTION 1305 #define IDS_SETTINGS_QUIETHOURS_SHOW_NOTIFICATIONS 1306 +#define IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TITLE 1307 +#define IDS_SETTINGS_QUIETHOURS_INVALID_TIME_RANGE_TEXT 1308 +#define IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TITLE 1309 +#define IDS_SETTINGS_QUIETHOURS_ERROR_WHILE_SAVING_TEXT 1310 #define IDS_SETTINGS_WIFI_INTRO 1400 #define IDS_SETTINGS_WIFI_ENABLE 1401 #define IDS_SETTINGS_WIFI_MUTE_WHEN_NOT_IN_LIST 1402 -- 2.43.0