From 6b6b6f011c313e1a3419bdbe3e50ce09a0fb7d9a Mon Sep 17 00:00:00 2001 From: shivam-51 Date: Wed, 20 Jan 2021 17:45:41 +0530 Subject: tdf#139136 Style Inspector: "true" and "false" now localizable Change-Id: Ib223e941ca4285a0eeae9127edc161311f56aa36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109709 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- svx/inc/inspectorvalues.hrc | 25 ++++++++++++++++++++++ .../sidebar/inspector/InspectorTextPanel.cxx | 4 +++- sw/qa/uitest/styleInspector/styleInspector.py | 8 +++---- 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 svx/inc/inspectorvalues.hrc diff --git a/svx/inc/inspectorvalues.hrc b/svx/inc/inspectorvalues.hrc new file mode 100644 index 000000000000..2a6c0d8cb03c --- /dev/null +++ b/svx/inc/inspectorvalues.hrc @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#define NC_(Context, String) reinterpret_cast(Context "\004" u8##String) +#define NNC_(Context, StringSingular, StringPlural) reinterpret_cast(Context "\004" u8##StringSingular "\004" u8##StringPlural) + +/*-------------------------------------------------------------------- + Description: API names for Paragraph, Character + and Text cursor values + --------------------------------------------------------------------*/ + +// Node names +#define RID_FALSE NC_("RID_ATTRIBUTE_NAMES_MAP", "False") +#define RID_TRUE NC_("RID_ATTRIBUTE_NAMES_MAP", "True") + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 4eb4a4889f8c..7c713696320a 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -20,12 +20,14 @@ #include #include +#include #include #include #include #include +#include using namespace css; @@ -68,7 +70,7 @@ static bool GetPropertyValues(const OUString& rPropName, const uno::Any& rAny, O if (bool bValue; rAny >>= bValue) { - rString = OUString::boolean(bValue); + rString = SvxResId(bValue ? RID_TRUE : RID_FALSE); // tdf#139136 } else if (OUString aValue; (rAny >>= aValue) && !(aValue.isEmpty())) { diff --git a/sw/qa/uitest/styleInspector/styleInspector.py b/sw/qa/uitest/styleInspector/styleInspector.py index 49337ee61761..0ab0c0a22719 100644 --- a/sw/qa/uitest/styleInspector/styleInspector.py +++ b/sw/qa/uitest/styleInspector/styleInspector.py @@ -40,7 +40,7 @@ class styleNavigator(UITestCase): xDirFormatting = xListBox.getChild('3') self.assertEqual(5, len(xDirFormatting.getChildren())) self.assertEqual("Char Back Color\t0xffff00", get_state_as_dict(xDirFormatting.getChild('0'))['Text']) - self.assertEqual("Char Back Transparent\tfalse", get_state_as_dict(xDirFormatting.getChild('1'))['Text']) + self.assertEqual("Char Back Transparent\tFalse", get_state_as_dict(xDirFormatting.getChild('1'))['Text']) self.assertEqual("Char Color\t0xc9211e", get_state_as_dict(xDirFormatting.getChild('2'))['Text']) self.assertEqual("Char Shading Value\t0", get_state_as_dict(xDirFormatting.getChild('3'))['Text']) self.assertEqual("Char Transparence\t0", get_state_as_dict(xDirFormatting.getChild('4'))['Text']) @@ -57,9 +57,9 @@ class styleNavigator(UITestCase): self.assertEqual(7, len(xParDirFormatting.getChildren())) self.assertEqual("Fill Color\t0xff0000", get_state_as_dict(xParDirFormatting.getChild('0'))['Text']) self.assertEqual("Para Back Color\t0xff0000", get_state_as_dict(xParDirFormatting.getChild('1'))['Text']) - self.assertEqual("Para Back Transparent\tfalse", get_state_as_dict(xParDirFormatting.getChild('2'))['Text']) + self.assertEqual("Para Back Transparent\tFalse", get_state_as_dict(xParDirFormatting.getChild('2'))['Text']) self.assertEqual("Para First Line Indent\t0", get_state_as_dict(xParDirFormatting.getChild('3'))['Text']) - self.assertEqual("Para is Auto First Line Indent\tfalse", get_state_as_dict(xParDirFormatting.getChild('4'))['Text']) + self.assertEqual("Para is Auto First Line Indent\tFalse", get_state_as_dict(xParDirFormatting.getChild('4'))['Text']) self.assertEqual("Para Left Margin\t1482", get_state_as_dict(xParDirFormatting.getChild('5'))['Text']) self.assertEqual("Para Right Margin\t0", get_state_as_dict(xParDirFormatting.getChild('6'))['Text']) @@ -93,7 +93,7 @@ class styleNavigator(UITestCase): 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']) + self.assertEqual("Para Expand Single Word\tFalse", get_state_as_dict(xTitleStyle.getChild('14'))['Text']) self.assertEqual("Para Last Line Adjust\t0", get_state_as_dict(xTitleStyle.getChild('15'))['Text']) self.assertEqual(0, len(xListBox.getChild('1').getChildren())) -- cgit