summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-01-28 10:03:32 -0500
committerAndras Timar <andras.timar@collabora.com>2019-03-04 15:21:15 +0100
commitd92715c797c290e16b04ebc957d908288f997439 (patch)
tree9eb6d34d52db7c2377fb22397866ecbed16e81b4 /configmgr
parent4c9f230ef4bc4400b6722c6fccbe32ef8fb2d05f (diff)
configmgr: support changing locale language
Change-Id: Ia8318ce8ca3ae9fdbd526e0d41861e2863fb9a94 Reviewed-on: https://gerrit.libreoffice.org/68262 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/access.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 0d19af353b49..09f4b98ee61d 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/uno/XWeak.hpp>
#include <com/sun/star/util/ElementChange.hpp>
#include <comphelper/sequence.hxx>
+#include <comphelper/lok.hxx>
#include <cppu/unotype.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -1390,6 +1391,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 adaption of RFC 4647 lookup matching
// rules, removing "-" or "_" delimited segments from the end: