]> repos.lx-s.de Git - winmute.git/commitdiff
Translated bluetooth-add-dlg
authorlx-s <lx-s@users.noreply.github.com>
Tue, 14 Nov 2023 19:38:34 +0000 (20:38 +0100)
committerlx-s <lx-s@users.noreply.github.com>
Tue, 14 Nov 2023 19:38:34 +0000 (20:38 +0100)
Translations/wm_de/resource.h
Translations/wm_de/wm_de.rc
WinMute/Settings_BluetoothDlg.cpp
WinMute/WinMute.rc
WinMute/resource.h

index edbfc494d73d199538be26a6595752636f0ab700..ebeb704d17431591c794c0683b6d917714978d32 100644 (file)
 #define IDS_TRAYMENU_MUTE_ALL_DEVICES   410
 #define IDS_TRAYMENU_SETTINGS           411
 #define IDS_TRAYMENU_EXIT               412
+#define IDS_SETTINGS_BTN_SAVE           1000
+#define IDS_SETTINGS_BTN_CANCEL         1001
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE 1101
+#define IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE 1102
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL 1103
 
 // Next default values for new objects
 // 
index 50f980dc83436ba2c2ca25a840b1822412aa7dac..972ef3df9a071cdac66070a2b46ddae465ee1122 100644 (file)
Binary files a/Translations/wm_de/wm_de.rc and b/Translations/wm_de/wm_de.rc differ
index 3d7417fd66174166fcfee50906a1038b9c85c1e1..900fd2f56e1a55fb2c69877dbfffd4bdc97848b1 100644 (file)
@@ -52,7 +52,6 @@ static bool GetPairedBtAudioDevices(std::vector<std::wstring>& devices)
    btdi.dwSize = sizeof(btdi);
    HBLUETOOTH_DEVICE_FIND hBtDevFind = BluetoothFindFirstDevice(&bfrp, &btdi);
    if (hBtDevFind == nullptr) {
-      PrintWindowsError(L"BluetoothFindFirstDevice");
       log.WriteWindowsError(L"BluetoothFindFirstDevice", GetLastError());
    } else {
       do {
@@ -66,6 +65,19 @@ static bool GetPairedBtAudioDevices(std::vector<std::wstring>& devices)
    return false;
 }
 
+static void LoadBluetoothAddDlgTranslation(HWND hDlg, bool isEdit)
+{
+   WMi18n &i18n = WMi18n::GetInstance();
+   if (isEdit) {
+      i18n.SetItemText(hDlg, IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE);
+   } else {
+      i18n.SetItemText(hDlg, IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE);
+   }
+   i18n.SetItemText(hDlg, IDC_LABEL_BT_DEVICE_NAME, IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL);
+   i18n.SetItemText(hDlg, IDOK, IDS_SETTINGS_BTN_SAVE);
+   i18n.SetItemText(hDlg, IDCANCEL, IDS_SETTINGS_BTN_CANCEL);
+}
+
 static INT_PTR CALLBACK Settings_BluetoothAddDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
    switch (msg) {
@@ -76,20 +88,8 @@ static INT_PTR CALLBACK Settings_BluetoothAddDlgProc(HWND hDlg, UINT msg, WPARAM
          return FALSE;
       }
       SetWindowLongPtr(hDlg, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(btDeviceData));
+      LoadBluetoothAddDlgTranslation(hDlg, btDeviceData->devName.length() == 0);
 
-      if (btDeviceData->devName.length() == 0) {
-         if (!SetWindowTextW(hDlg, L"Add Bluetooth device")) {
-             PrintWindowsError(L"SetWindowText", GetLastError());
-            return FALSE;
-         }
-      } else {
-         if (!SetWindowTextW(hDlg, L"Edit Bluetooth device")
-             || !SetWindowTextW(GetDlgItem(hDlg, IDC_BT_DEVICE_NAME),
-                               btDeviceData->devName.c_str())) {
-            PrintWindowsError(L"SetWindowText", GetLastError());
-            return FALSE;
-         }
-      }
       // Fill Combobox
       std::vector<std::wstring> registeredBtDevices;
       if (GetPairedBtAudioDevices(registeredBtDevices)) {
index 4e9d6ecf90748a329d5cd3abd768231b1d66ebcb..6a2e07f57f8f8460976ac2e1a088683cf366b6ff 100644 (file)
@@ -205,7 +205,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
 BEGIN
     DEFPUSHBUTTON   "Save",IDOK,91,41,50,14
     PUSHBUTTON      "Cancel",IDCANCEL,144,41,50,14
-    LTEXT           "Bluetooth device name:",IDC_STATIC,7,7,187,14
+    LTEXT           "Bluetooth device name:",IDC_LABEL_BT_DEVICE_NAME,7,7,187,14
     COMBOBOX        IDC_BT_DEVICE_NAME,7,22,187,17,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
 END
 
@@ -626,6 +626,19 @@ BEGIN
     IDS_TRAYMENU_EXIT       "Exit"
 END
 
+STRINGTABLE
+BEGIN
+    IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE "Add bluetooth device"
+    IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE "Edit bluetooth device"
+    IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL "Bluetooth device name:"
+END
+
+STRINGTABLE
+BEGIN
+    IDS_SETTINGS_BTN_SAVE   "Save"
+    IDS_SETTINGS_BTN_CANCEL "Cancel"
+END
+
 #endif    // English (United Kingdom) resources
 /////////////////////////////////////////////////////////////////////////////
 
index 2d293ffb4bc0ade3ecc33135683b8d03c8b03921..7573827189ee2bc08cd05eabe125ba11c52b6e2b 100644 (file)
@@ -68,7 +68,9 @@
 #define IDS_TRAYMENU_MUTE_ALL_DEVICES   410
 #define IDS_TRAYMENU_SETTINGS           411
 #define IDS_TRAYMENU_EXIT               412
+#define IDS_SETTINGS_BTN_SAVE           1000
 #define IDC_LINK_HOMEPAGE               1001
+#define IDS_SETTINGS_BTN_CANCEL         1001
 #define IDC_LINK_SUPPORT                1002
 #define IDC_LINK_PROJECT                1002
 #define IDC_ENABLEQUIETHOURS            1003
 #define IDC_ENDPOINT_NAME               1049
 #define IDC_MUTEDELAY                   1050
 #define IDC_LANGUAGE                    1051
+#define IDC_LABEL_BT_DEVICE_NAME        1052
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_TITLE 1101
+#define IDS_SETTINGS_BLUETOOTH_EDIT_DLG_TITLE 1102
+#define IDS_SETTINGS_BLUETOOTH_ADD_DLG_DEVICE_NAME_LABEL 1103
 #define ID_TRAYMENU_INFO                40001
 #define ID_TRAYMENU_                    40002
 #define ID_TRAYMENU_MUTEON              40003
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        140
 #define _APS_NEXT_COMMAND_VALUE         40041
-#define _APS_NEXT_CONTROL_VALUE         1052
+#define _APS_NEXT_CONTROL_VALUE         1053
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif