From f7fcab4c219b7187ce9d6ca300c96f06f8f2e877 Mon Sep 17 00:00:00 2001
From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com>
Date: Mon, 13 Feb 2023 07:29:59 +0100
Subject: [PATCH] Make categories in the Shortcut Mapper dialog translatable
Fix #8858, close #13110
---
PowerEditor/installer/nativeLang/english.xml | 11 +++++++++++
.../installer/nativeLang/english_customizable.xml | 11 +++++++++++
PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp | 7 ++++++-
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml
index 2140d96ad..51158cb88 100644
--- a/PowerEditor/installer/nativeLang/english.xml
+++ b/PowerEditor/installer/nativeLang/english.xml
@@ -592,6 +592,17 @@ The comments are here for explanation, it's not necessary to translate them.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml
index 066500c1a..bc932304b 100644
--- a/PowerEditor/installer/nativeLang/english_customizable.xml
+++ b/PowerEditor/installer/nativeLang/english_customizable.xml
@@ -536,6 +536,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp b/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp
index 01af5bd90..7ce9f5d47 100644
--- a/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp
+++ b/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp
@@ -287,6 +287,7 @@ void ShortcutMapper::fillOutBabyGrid()
{
case STATE_MENU:
{
+ NativeLangSpeaker* nativeLangSpeaker = NppParameters::getInstance().getNativeLangSpeaker();
vector & cshortcuts = nppParam.getUserShortcuts();
cs_index = 1;
for (size_t i = 0; i < nbItems; ++i)
@@ -299,7 +300,11 @@ void ShortcutMapper::fillOutBabyGrid()
_babygrid.setText(cs_index, 1, cshortcuts[i].getName());
if (cshortcuts[i].isEnabled()) //avoid empty strings for better performance
_babygrid.setText(cs_index, 2, cshortcuts[i].toString().c_str());
- _babygrid.setText(cs_index, 3, cshortcuts[i].getCategory());
+
+ const TCHAR* category = cshortcuts[i].getCategory();
+ generic_string categoryStr = nativeLangSpeaker->getShortcutMapperLangStr((std::string(wstring2string(category, CP_UTF8)) + "Category").c_str(), category);
+ _babygrid.setText(cs_index, 3, categoryStr.c_str());
+
if (isMarker)
isMarker = _babygrid.setMarker(false);
_shortcutIndex.push_back(i);