desktop/source/lib/init.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit ddc5a7bb10c6229018dbdb3192740b6d893fa08b
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Sun Jul 24 08:46:38 2022 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Sep 22 08:30:12 2022 +0200

    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.nakash...@collabora.co.uk>
    Change-Id: I0cd1574d48a99e6ee84bacf75fc0d9ebe26e526b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137391
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    (cherry picked from commit a0b2739b2354b622538304c0846606247bcf09c0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140362
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

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));

Reply via email to