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.kaganski@collabora.com>
This commit is contained in:
parent
1190623696
commit
0de274e62c
3 changed files with 15 additions and 3 deletions
|
@ -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) );
|
||||
}
|
||||
|
|
|
@ -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() ) );
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue