diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-07-24 08:46:38 -0400 |
---|---|---|
committer | Ashod Nakashian <ash@collabora.com> | 2022-07-25 15:34:33 +0200 |
commit | a0b2739b2354b622538304c0846606247bcf09c0 (patch) | |
tree | 66b04d465f07893ea6cb5e141586a5983c8fa5b8 /desktop | |
parent | 3de8fcd83ade8a7a82ee8da393ed49fd5de58254 (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>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4ab030388e7f..3f708aa781c9 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2495,6 +2495,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)); |