From 0d57cca50ae844260b27556b8ede3f1ffd1ca243 Mon Sep 17 00:00:00 2001 From: lx-s Date: Fri, 8 Dec 2023 21:36:52 +0100 Subject: [PATCH] Translated about dialog --- Translations/wm_de/resource.h | 8 ++++++ Translations/wm_de/wm_de.rc | Bin 22184 -> 23630 bytes WinMute/AboutDlg.cpp | 51 ++++++++++++++++++++++++---------- WinMute/WinMute.rc | 15 +++++++++- WinMute/resource.h | 10 ++++++- 5 files changed, 67 insertions(+), 17 deletions(-) diff --git a/Translations/wm_de/resource.h b/Translations/wm_de/resource.h index 25d399b..8b3a1ed 100644 --- a/Translations/wm_de/resource.h +++ b/Translations/wm_de/resource.h @@ -100,6 +100,14 @@ #define IDS_SETTINGS_WIFI_EDIT_DLG_TITLE 1451 #define IDS_SETTINGS_WIFI_ADD_DLG_SSID_NAME_LABEL 1452 #define IDS_SETTINGS_WIFI_ADD_DLG_ENTER_DEVICE_NAME_TEXT 1453 +#define IDS_ABOUT_TITLE 2000 +#define IDS_ABOUT_GENERAL_AUTHOR_SITE_LABEL 2001 +#define IDS_ABOUT_GENERAL_PROJECT_SITE_LABEL 2002 +#define IDS_ABOUT_GENERAL_SUPPORT_LABEL 2003 +#define IDS_ABOUT_GENERAL_DESCRIPTION 2004 +#define IDS_ABOUT_TAB_WINMUTE 2005 +#define IDS_ABOUT_TAB_LICENSE 2006 +#define IDS_ABOUT_CLOSE_BTN 2007 // Next default values for new objects // diff --git a/Translations/wm_de/wm_de.rc b/Translations/wm_de/wm_de.rc index 91096eeef3e0dbb9631f7f76e00b168106939ac5..14abe4d180c2f9503fdca5ccb23ee90c2de7c54f 100644 GIT binary patch delta 1140 zcmaKr&uSA<6vj^x)P=Y(6saJLSyTj*(nV3+C27(|r%lX6rK>X9X|0VD$e*T^LY_ee zdwhC$s zDH3M3*vb{EU<_;o)*IWij>CQe`pB&!ngc6X--@>7Sr#v2X@cIcr|?!>?B_fWn#A0- zci`{A7Z5=LCz10%&kFG9o^fnk#u1T8lch{lpODA55|Zc#3C2V{0rteO_o;rgoenePcRBi1r)R_0?MK?@9>T7J!>DW z(%*HVizuK0C!F$;6yv$gxq{7r@{NbQuz)P&IK;$Pa0j`AvGSGM$lZHMp_Y*a(6e9A zD-@r54dNbw{Hflg&-M^q8!NrL1kXM)FF^S#=Ne~>dWe)jcM5GEV+D4RK5&FR?sX$_ z6%k#@7DML delta 18 acmX@NgK@=L#tk*Wllj=CHrqrBF#`Zg3 tabs) } } +static void TranslateAboutGeneralDlgProc(HWND hDlg) +{ + WMi18n &i18n = WMi18n::GetInstance(); + + const auto hpLink = std::vformat( + L"{}", + std::make_wformat_args(i18n.GetTextW(IDS_ABOUT_GENERAL_AUTHOR_SITE_LABEL))); + + const auto projLink = std::vformat( + L"{}", + std::make_wformat_args(i18n.GetTextW(IDS_ABOUT_GENERAL_PROJECT_SITE_LABEL))); + + const auto supportLink = std::vformat( + L"{}", + std::make_wformat_args(i18n.GetTextW(IDS_ABOUT_GENERAL_SUPPORT_LABEL))); + + SetDlgItemTextW(hDlg, IDC_LINK_HOMEPAGE, hpLink.c_str()); + SetDlgItemTextW(hDlg, IDC_LINK_PROJECT, projLink.c_str()); + SetDlgItemTextW(hDlg, IDC_LINK_TICKETS, supportLink.c_str()); + + i18n.SetItemText(hDlg, IDC_ABOUTTEXT, IDS_ABOUT_GENERAL_DESCRIPTION); +} + static INT_PTR CALLBACK About_GeneralDlgProc(HWND hDlg, UINT msg, WPARAM, LPARAM lParam) noexcept { switch (msg) { @@ -165,7 +176,7 @@ static INT_PTR CALLBACK About_GeneralDlgProc(HWND hDlg, UINT msg, WPARAM, LPARAM if (IsAppThemed()) { EnableThemeDialogTexture(hDlg, ETDT_ENABLETAB); } - Edit_SetText(GetDlgItem(hDlg, IDC_ABOUTTEXT), aboutText.c_str()); + TranslateAboutGeneralDlgProc(hDlg); return TRUE; case WM_NOTIFY: { const PNMLINK pNmLink = reinterpret_cast(lParam); @@ -202,6 +213,13 @@ static INT_PTR CALLBACK About_LicenseDlgProc(HWND hDlg, UINT msg, WPARAM, LPARAM return FALSE; } +static void TranslateAboutDlgProc(HWND hDlg) +{ + WMi18n &i18n = WMi18n::GetInstance(); + SetWindowText(hDlg, i18n.GetTextW(IDS_ABOUT_TITLE).c_str()); + i18n.SetItemText(hDlg, IDOK, IDS_ABOUT_CLOSE_BTN); +} + INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { AboutDlgData* dlgData = @@ -213,8 +231,11 @@ INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) dlgData->hTabCtrl = GetDlgItem(hDlg, IDC_ABOUT_TAB); - InsertTabItem(dlgData->hTabCtrl, ABOUT_TAB_GENERAL, L"WinMute"); - InsertTabItem(dlgData->hTabCtrl, ABOUT_TAB_LICENSE, L"License"); + WMi18n &i18n = WMi18n::GetInstance(); + InsertTabItem(dlgData->hTabCtrl, ABOUT_TAB_GENERAL, i18n.GetTextW(IDS_ABOUT_TAB_WINMUTE)); + InsertTabItem(dlgData->hTabCtrl, ABOUT_TAB_LICENSE, i18n.GetTextW(IDS_ABOUT_TAB_LICENSE)); + + TranslateAboutDlgProc(hDlg); dlgData->hTabs[ABOUT_TAB_GENERAL] = CreateDialog( nullptr, diff --git a/WinMute/WinMute.rc b/WinMute/WinMute.rc index 2c252a9..97384cb 100644 --- a/WinMute/WinMute.rc +++ b/WinMute/WinMute.rc @@ -120,7 +120,7 @@ BEGIN "SysLink",WS_TABSTOP,197,32,94,14 CONTROL "Support",IDC_LINK_TICKETS, "SysLink",WS_TABSTOP,197,49,94,14 - EDITTEXT IDC_ABOUTTEXT,7,14,182,155,ES_MULTILINE | ES_AUTOHSCROLL | ES_NOHIDESEL | ES_READONLY | NOT WS_BORDER + EDITTEXT IDC_ABOUTTEXT,7,14,182,144,ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_READONLY | NOT WS_BORDER END IDD_SETTINGS_MUTE DIALOGEX 0, 0, 242, 222 @@ -730,6 +730,19 @@ BEGIN "Please enter a SSID/WiFi name" END +STRINGTABLE +BEGIN + IDS_ABOUT_TITLE "About WinMute" + IDS_ABOUT_GENERAL_AUTHOR_SITE_LABEL "Author: www.lx-s.de" + IDS_ABOUT_GENERAL_PROJECT_SITE_LABEL "Project Site && Code" + IDS_ABOUT_GENERAL_SUPPORT_LABEL "Support" + IDS_ABOUT_GENERAL_DESCRIPTION + "WinMute is developed by Alexander Steinhoefer his spare time. The code as well as new releases for this tool can be found on GitHub. Contributions in the form of code, tickets or feature requests are very welcome. Thank your for using this little tool!" + IDS_ABOUT_TAB_WINMUTE "WinMute" + IDS_ABOUT_TAB_LICENSE "License" + IDS_ABOUT_CLOSE_BTN "OK" +END + #endif // English (United Kingdom) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/WinMute/resource.h b/WinMute/resource.h index 569dd42..67b7bc6 100644 --- a/WinMute/resource.h +++ b/WinMute/resource.h @@ -197,6 +197,14 @@ #define IDS_SETTINGS_WIFI_EDIT_DLG_TITLE 1451 #define IDS_SETTINGS_WIFI_ADD_DLG_SSID_NAME_LABEL 1452 #define IDS_SETTINGS_WIFI_ADD_DLG_ENTER_DEVICE_NAME_TEXT 1453 +#define IDS_ABOUT_TITLE 2000 +#define IDS_ABOUT_GENERAL_AUTHOR_SITE_LABEL 2001 +#define IDS_ABOUT_GENERAL_PROJECT_SITE_LABEL 2002 +#define IDS_ABOUT_GENERAL_SUPPORT_LABEL 2003 +#define IDS_ABOUT_GENERAL_DESCRIPTION 2004 +#define IDS_ABOUT_TAB_WINMUTE 2005 +#define IDS_ABOUT_TAB_LICENSE 2006 +#define IDS_ABOUT_CLOSE_BTN 2007 #define ID_TRAYMENU_INFO 40001 #define ID_TRAYMENU_ 40002 #define ID_TRAYMENU_MUTEON 40003 @@ -244,7 +252,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 141 #define _APS_NEXT_COMMAND_VALUE 40041 -#define _APS_NEXT_CONTROL_VALUE 1065 +#define _APS_NEXT_CONTROL_VALUE 1066 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif -- 2.43.0