editeng/source/misc/unolingu.cxx | 6 +++++- linguistic/source/dlistimp.cxx | 6 +++++- linguistic/source/misc.cxx | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-)
New commits: commit 0de274e62c0b7154222178de234c504dc916ede4 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Dec 22 13:29:01 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Dec 22 13:28:01 2023 +0100 Lok: make Ignore All list name independent on UI language Fixes not working "Ignore All" context menu entry in e.g. German UI in Online. Change-Id: I761c9f65c89fb5c7e929ea20f2db4eff20f7d53d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161170 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index 1e7b69a25f27..bd1fae50654e 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/linguistic2/LinguProperties.hpp> #include <com/sun/star/linguistic2/XSpellChecker1.hpp> +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase.hxx> #include <i18nlangtag/languagetag.hxx> @@ -595,7 +596,10 @@ uno::Reference< XDictionary > LinguMgr::GetIgnoreAll() uno::Reference< XSearchableDictionaryList > xTmpDicList( GetDictionaryList() ); if (xTmpDicList.is()) { - std::locale loc(Translate::Create("svt")); + const LanguageTag tag = comphelper::LibreOfficeKit::isActive() + ? LanguageTag("en-US") + : SvtSysLocale().GetUILanguageTag(); + std::locale loc(Translate::Create("svt", tag)); xIgnoreAll = xTmpDicList->getDictionaryByName( Translate::get(STR_DESCRIPTION_IGNOREALLLIST, loc) ); } diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 281abce9e11a..ba39271eee0c 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -27,6 +27,7 @@ #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/weak.hxx> #include <unotools/localfilehelper.hxx> +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -586,7 +587,10 @@ void DicList::CreateDicList() // create IgnoreAllList dictionary with empty URL (non persistent) // and add it to list - std::locale loc(Translate::Create("svt")); + const LanguageTag tag = comphelper::LibreOfficeKit::isActive() + ? LanguageTag("en-US") + : SvtSysLocale().GetUILanguageTag(); + std::locale loc(Translate::Create("svt", tag)); uno::Reference< XDictionary > xIgnAll( createDictionary( Translate::get(STR_DESCRIPTION_IGNOREALLLIST, loc), LinguLanguageToLocale( LANGUAGE_NONE ), DictionaryType_POSITIVE, OUString() ) ); diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index c315ad1270ee..5c50af6f1946 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Reference.h> +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> #include <unotools/charclass.hxx> @@ -690,7 +691,10 @@ uno::Reference< XDictionary > GetIgnoreAllList() uno::Reference< XSearchableDictionaryList > xDL( GetDictionaryList() ); if (xDL.is()) { - std::locale loc(Translate::Create("svt")); + const LanguageTag tag = comphelper::LibreOfficeKit::isActive() + ? LanguageTag("en-US") + : SvtSysLocale().GetUILanguageTag(); + std::locale loc(Translate::Create("svt", tag)); xRes = xDL->getDictionaryByName( Translate::get(STR_DESCRIPTION_IGNOREALLLIST, loc) ); } return xRes;