summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2022-07-24 08:46:38 -0400
committerMiklos Vajna <vmiklos@collabora.com>2022-09-22 08:30:12 +0200
commitddc5a7bb10c6229018dbdb3192740b6d893fa08b (patch)
treee27b7844850c409747f0e682f4b6e3f727923cc3 /desktop
parent90e3244aa6c15a42c5c86ebe5b36592085de9c79 (diff)
lok: initialize the load-language
We need to use the load-language for saving the document. This is to avoid using the language of the view that is issuing the save, which causes all sorts of issues (language-translation related). This logic was implemented in 4b7b449bbdc5 but for some reason the load-language wasn't set. This patch sets the load-language. Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk> Change-Id: I0cd1574d48a99e6ee84bacf75fc0d9ebe26e526b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137391 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit a0b2739b2354b622538304c0846606247bcf09c0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140362 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5e562862da53..7d9c4cfc3643 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2513,6 +2513,14 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
if (!aLanguage.isEmpty() && isValidLangTag)
{
+ static bool isLoading = true;
+ if (isLoading)
+ {
+ // Capture the language used to load the document.
+ SfxLokHelper::setLoadLanguage(aLanguage);
+ isLoading = false;
+ }
+
SfxLokHelper::setDefaultLanguage(aLanguage);
// Set the LOK language tag, used for dialog tunneling.
comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(aLanguage));