sfx2/source/view/viewsh.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bb4a5fa170ee26aea020a822fca88a20d75d48fd
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Mon Jun 24 01:23:22 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jun 24 01:23:22 2024 +0200

    LOK: fix UI language fallback, e.g. zh-HK -> zh-TW
    
    The original author wanted to handle de-CH as special case, but
    he wrote a general condition.
    - comphelper::LibreOfficeKit::isActive() is redundant, because we
      call SfxViewShell::SetLOKLanguageTag() from LOK.
    - AFAIK there are no other, similar cases. We know about only de-CH,
      so let's make it explicit in the condition.
    - This fixes UI language setting when the integration asks for zh-HK.
      Previously it falsely fell back to en-US here, instead of zh-TW.
    
    Change-Id: Ie42e09b8e202b654b109ab8d777ab36a5ef56dca

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 0b6c07c68d5c..f1a95138db86 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -3357,8 +3357,8 @@ void SfxViewShell::SetLOKLanguageTag(const OUString& 
rBcp47LanguageTag)
     LanguageTag aFallbackTag = 
LanguageTag(getInstalledLocaleForSystemUILanguage(inst, /* 
bRequestInstallIfMissing */ false, rBcp47LanguageTag), true).makeFallback();
 
     // If we want de-CH, and the de localisation is available, we don't want 
to use de-DE as then
-    // the magic in Translate::get() won't turn ess-zet into double s. 
Possibly other similar cases?
-    if (comphelper::LibreOfficeKit::isActive() && aTag.getLanguage() == 
aFallbackTag.getLanguage())
+    // the magic in Translate::get() won't turn ess-zet into double s.
+    if (rBcp47LanguageTag == "de-CH")
         maLOKLanguageTag = aTag;
     else
         maLOKLanguageTag = aFallbackTag;

Reply via email to