[Libreoffice-commits] core.git: configmgr/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 12 07:46:33 UTC 2019


 configmgr/source/access.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 5ede6b3bca9d174c77d16a1bc182ab83eb963398
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Mon Jan 28 10:03:32 2019 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jun 12 09:45:12 2019 +0200

    configmgr: support changing locale language
    
    Change-Id: Ia8318ce8ca3ae9fdbd526e0d41861e2863fb9a94
    Reviewed-on: https://gerrit.libreoffice.org/68262
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/73485
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index b2fcb3cf9ad0..6e8fc5227590 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -71,6 +71,8 @@
 #include <com/sun/star/uno/XWeak.hpp>
 #include <com/sun/star/util/ElementChange.hpp>
 #include <comphelper/sequence.hxx>
+#include <comphelper/lok.hxx>
+#include <i18nlangtag/languagetag.hxx>
 #include <cppu/unotype.hxx>
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/supportsservice.hxx>
@@ -1380,6 +1382,13 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) {
             locale.isEmpty(), "configmgr",
             ("access best-matching localized property value via \"*<locale>\""
              " with empty <locale>; falling back to defaults"));
+
+        // Since the locale given to us is the one used at initialization,
+        // here we override it with the actual current-user's language to
+        // support per-view localization in LOK.
+        if (comphelper::LibreOfficeKit::isActive())
+            locale = comphelper::LibreOfficeKit::getLanguageTag().getLanguage();
+
         if (!locale.isEmpty()) {
             // Find best match using an adaptation of RFC 4647 lookup matching
             // rules, removing "-" or "_" delimited segments from the end:


More information about the Libreoffice-commits mailing list