VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume/WinMain.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-25 00:41:02 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-25 00:41:02 +0200
commit394ed5d867402b8dec51094281492c1552d5478e (patch)
tree71a9bc071c798d940e1a4d0ad8d8f24bbe851221 /src/ExpandVolume/WinMain.cpp
parent52b3e0113a94d09c136320f302f0c2e0dead27a2 (diff)
downloadVeraCrypt-394ed5d867402b8dec51094281492c1552d5478e.tar.gz
VeraCrypt-394ed5d867402b8dec51094281492c1552d5478e.zip
Windows: Better language localization support for Expander.
More work is needed to localize remaining string resources
Diffstat (limited to 'src/ExpandVolume/WinMain.cpp')
-rw-r--r--src/ExpandVolume/WinMain.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp
index bcaaefa8..42f1c28d 100644
--- a/src/ExpandVolume/WinMain.cpp
+++ b/src/ExpandVolume/WinMain.cpp
@@ -199,6 +199,10 @@ BOOL CheckSysEncMountWithoutPBA (const char *devicePath, BOOL quiet)
static void InitMainDialog (HWND hwndDlg)
{
+ MENUITEMINFOW info;
+ int i;
+ wchar_t *str;
+ int menuEntries[] = {IDM_ABOUT, IDM_HOMEPAGE};
/* Call the common dialog init code */
InitDialog (hwndDlg);
LocalizeDialog (hwndDlg, NULL);
@@ -207,7 +211,27 @@ static void InitMainDialog (HWND hwndDlg)
SetWindowTextW (hwndDlg, lpszTitle);
SendMessage (GetDlgItem (hwndDlg, IDC_INFOEXPAND), WM_SETFONT, (WPARAM) hBoldFont, (LPARAM) TRUE);
- SetWindowText (GetDlgItem (hwndDlg, IDC_INFOEXPAND), szExpandVolumeInfo);
+ SetWindowText (GetDlgItem (hwndDlg, IDC_INFOEXPAND), GetString("EXPANDER_INFO"));
+
+ // Localize menu strings
+ for (i = 0; i < array_capacity (menuEntries); i++)
+ {
+ str = (wchar_t *)GetDictionaryValueByInt (menuEntries[i]);
+ if (str)
+ {
+ ZeroMemory (&info, sizeof(info));
+ info.cbSize = sizeof (info);
+ info.fMask = MIIM_TYPE;
+ info.fType = MFT_STRING;
+ if (GetMenuItemInfoW (GetMenu (hwndDlg), menuEntries[i], FALSE, &info))
+ {
+ info.dwTypeData = str;
+ info.cch = (UINT) wcslen (str);
+
+ SetMenuItemInfoW (GetMenu (hwndDlg), menuEntries[i], FALSE, &info);
+ }
+ }
+ }
// Resize the logo bitmap if the user has a non-default DPI
if (ScreenDPI != USER_DEFAULT_SCREEN_DPI