From 0c704fd66b12170c17ccd97c6b5f3d72e40e241c Mon Sep 17 00:00:00 2001
From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com>
Date: Mon, 13 Feb 2023 13:12:46 +0100
Subject: [PATCH] Make theme warning message translatable (switching unsaved
theme to another)
Fix report from comment: #8972 (comment).
Close #13112
---
PowerEditor/installer/nativeLang/english.xml | 2 ++
.../installer/nativeLang/english_customizable.xml | 2 ++
.../src/WinControls/ColourPicker/WordStyleDlg.cpp | 15 +++++++++------
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml
index 51158cb88..66f27afe4 100644
--- a/PowerEditor/installer/nativeLang/english.xml
+++ b/PowerEditor/installer/nativeLang/english.xml
@@ -1418,6 +1418,8 @@ Continue?"/>
+
diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml
index bc932304b..2a51653a3 100644
--- a/PowerEditor/installer/nativeLang/english_customizable.xml
+++ b/PowerEditor/installer/nativeLang/english_customizable.xml
@@ -1247,6 +1247,8 @@ Continue?"/>
+
diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
index 423f7b304..eda01e6e8 100644
--- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
+++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
@@ -21,6 +21,7 @@
#include "documentMap.h"
#include "AutoCompletion.h"
#include "preference_rc.h"
+#include "localization.h"
using namespace std;
@@ -798,12 +799,14 @@ void WordStyleDlg::switchToTheme()
wcscpy_s(themeFileName, prevThemeName.c_str());
PathStripPath(themeFileName);
PathRemoveExtension(themeFileName);
- int mb_response =
- ::MessageBox( _hSelf,
- TEXT(" Unsaved changes are about to be discarded!\n")
- TEXT(" Do you want to save your changes before switching themes?"),
- themeFileName,
- MB_ICONWARNING | MB_YESNO | MB_APPLMODAL | MB_SETFOREGROUND );
+ NativeLangSpeaker *pNativeSpeaker = nppParamInst.getNativeLangSpeaker();
+ int mb_response = pNativeSpeaker->messageBox("SwitchUnsavedThemeWarning",
+ _hSelf,
+ TEXT("Unsaved changes are about to be discarded!\nDo you want to save your changes before switching themes?"),
+ TEXT("$STR_REPLACE$"),
+ MB_ICONWARNING | MB_YESNO | MB_APPLMODAL | MB_SETFOREGROUND,
+ 0,
+ themeFileName);
if ( mb_response == IDYES )
(NppParameters::getInstance()).writeStyles(_lsArray, _globalStyles);
}