svx/inc/inspectorvalues.hrc                         |    4 ++++
 svx/source/sidebar/inspector/InspectorTextPanel.cxx |    6 ++----
 sw/qa/uitest/styleInspector/styleInspector.py       |    8 ++++----
 sw/qa/uitest/styleInspector/tdf137513.py            |    6 +++---
 4 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 8dfad592b4ab0497c140a921b8f56977a383f1d1
Author:     shivam-51 <shivamhere...@gmail.com>
AuthorDate: Fri Feb 5 18:21:50 2021 +0530
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Mar 7 09:33:49 2021 +0100

    tdf#140051 SI property values like "Bold" are now localisable
    
    This patch now allows "Bold", "Italic" and "Normal" to
    be localisable.
    
    Change-Id: Icd8102ce84db9a3c68ab69f5f9eadf0cf04755b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110475
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/svx/inc/inspectorvalues.hrc b/svx/inc/inspectorvalues.hrc
index 2a6c0d8cb03c..863b13b899e8 100644
--- a/svx/inc/inspectorvalues.hrc
+++ b/svx/inc/inspectorvalues.hrc
@@ -18,6 +18,10 @@
  --------------------------------------------------------------------*/
 
 // Node names
+#define RID_NORMAL                                          
NC_("RID_ATTRIBUTE_NAMES_MAP", "Normal")
+#define RID_BOLD                                            
NC_("RID_ATTRIBUTE_NAMES_MAP", "Bold")
+#define RID_ITALIC                                          
NC_("RID_ATTRIBUTE_NAMES_MAP", "Italic")
+
 #define RID_FALSE                                           
NC_("RID_ATTRIBUTE_NAMES_MAP", "False")
 #define RID_TRUE                                            
NC_("RID_ATTRIBUTE_NAMES_MAP", "True")
 
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 7b07be9997c4..493c4e37451f 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -79,8 +79,7 @@ static bool GetPropertyValues(const OUString& rPropName, 
const uno::Any& rAny, O
     }
     else if (awt::FontSlant eValue; rAny >>= eValue)
     {
-        rString = (eValue == awt::FontSlant_ITALIC) ? 
OUStringLiteral(u"italic")
-                                                    : 
OUStringLiteral(u"normal");
+        rString = SvxResId(eValue == awt::FontSlant_ITALIC ? RID_ITALIC : 
RID_NORMAL);
     }
     else if (tools::Long nValueLong; rAny >>= nValueLong)
     {
@@ -92,8 +91,7 @@ static bool GetPropertyValues(const OUString& rPropName, 
const uno::Any& rAny, O
     else if (double fValue; rAny >>= fValue)
     {
         if (rPropName.indexOf("Weight") != -1)
-            rString
-                = (fValue > 100) ? std::u16string_view(u"bold") : 
std::u16string_view(u"normal");
+            rString = SvxResId(fValue > 100 ? RID_BOLD : RID_NORMAL);
         else
             rString = OUString::number((round(fValue * 100)) / 100.00);
     }
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py 
b/sw/qa/uitest/styleInspector/styleInspector.py
index 0ab0c0a22719..1b8cc0c68d90 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -88,9 +88,9 @@ class styleNavigator(UITestCase):
         self.assertEqual("Char Property Height\t100", 
get_state_as_dict(xTitleStyle.getChild('6'))['Text'])
         self.assertEqual("Char Property Height Asian\t100", 
get_state_as_dict(xTitleStyle.getChild('7'))['Text'])
         self.assertEqual("Char Property Height Complex\t100", 
get_state_as_dict(xTitleStyle.getChild('8'))['Text'])
-        self.assertEqual("Char Weight\tbold", 
get_state_as_dict(xTitleStyle.getChild('9'))['Text'])
-        self.assertEqual("Char Weight Asian\tbold", 
get_state_as_dict(xTitleStyle.getChild('10'))['Text'])
-        self.assertEqual("Char Weight Complex\tbold", 
get_state_as_dict(xTitleStyle.getChild('11'))['Text'])
+        self.assertEqual("Char Weight\tBold", 
get_state_as_dict(xTitleStyle.getChild('9'))['Text'])
+        self.assertEqual("Char Weight Asian\tBold", 
get_state_as_dict(xTitleStyle.getChild('10'))['Text'])
+        self.assertEqual("Char Weight Complex\tBold", 
get_state_as_dict(xTitleStyle.getChild('11'))['Text'])
         self.assertEqual("Follow Style\tText body", 
get_state_as_dict(xTitleStyle.getChild('12'))['Text'])
         self.assertEqual("Para Adjust\t3", 
get_state_as_dict(xTitleStyle.getChild('13'))['Text'])
         self.assertEqual("Para Expand Single Word\tFalse", 
get_state_as_dict(xTitleStyle.getChild('14'))['Text'])
@@ -118,7 +118,7 @@ class styleNavigator(UITestCase):
         self.assertEqual("Char Height\t20", 
get_state_as_dict(xCustomStyle.getChild('2'))['Text'])
         self.assertEqual("Char Property Height\t100", 
get_state_as_dict(xCustomStyle.getChild('3'))['Text'])
         self.assertEqual("Char Transparence\t0", 
get_state_as_dict(xCustomStyle.getChild('4'))['Text'])
-        self.assertEqual("Char Weight\tbold", 
get_state_as_dict(xCustomStyle.getChild('5'))['Text'])
+        self.assertEqual("Char Weight\tBold", 
get_state_as_dict(xCustomStyle.getChild('5'))['Text'])
         self.assertEqual("Follow Style\tCustom_Style", 
get_state_as_dict(xCustomStyle.getChild('6'))['Text'])
 
         self.assertEqual(7, 
len(xListBox.getChild('0').getChild('2').getChildren()))
diff --git a/sw/qa/uitest/styleInspector/tdf137513.py 
b/sw/qa/uitest/styleInspector/tdf137513.py
index 2d4fb4d8b348..b3884e078b17 100644
--- a/sw/qa/uitest/styleInspector/tdf137513.py
+++ b/sw/qa/uitest/styleInspector/tdf137513.py
@@ -45,9 +45,9 @@ class tdf137513(UITestCase):
         # Without the fix in place, this test would have failed here with
         # AssertionError: 3 != 0
         self.assertEqual(3, len(xParDirFormatting.getChildren()))
-        self.assertEqual("Char Weight\tbold", 
get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
-        self.assertEqual("Char Weight Asian\tbold", 
get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
-        self.assertEqual("Char Weight Complex\tbold", 
get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
+        self.assertEqual("Char Weight\tBold", 
get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
+        self.assertEqual("Char Weight Asian\tBold", 
get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
+        self.assertEqual("Char Weight Complex\tBold", 
get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
         self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
         self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to