summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-02-08 11:10:58 +0100
committerAndras Timar <andras.timar@collabora.com>2023-07-05 09:12:22 +0200
commite2bb227d0762a4200ce6f064f7b53911c6d16fdf (patch)
tree781f2cd803aae1f2cf17da5961a8102c69fc6761 /lingucomponent
parent84bdf9e81a63a8bd308709c86b51bf3900a23c50 (diff)
lok: LanguageTool provides list of languages
- it sends supported list to the LOK client - disables Spell Checker for locales supported by LanguageTool - duden protocol supports only german - initialize language tool config before usage to fetch correct list of supported languages Change-Id: Id9de8519303774163721def8661fa408da449348 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146665 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153960 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx
index f7fe29edecca..1537e036f035 100644
--- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx
+++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx
@@ -130,8 +130,18 @@ Sequence<Locale> SAL_CALL LanguageToolGrammarChecker::getLocales()
SvtLinguConfig aLinguCfg;
uno::Sequence<OUString> aLocaleList;
- aLinguCfg.GetLocaleListFor("GrammarCheckers", "org.openoffice.lingu.LanguageToolGrammarChecker",
- aLocaleList);
+
+ SvxLanguageToolOptions& rLanguageOpts = SvxLanguageToolOptions::Get();
+ if (rLanguageOpts.getRestProtocol() == sDuden)
+ {
+ aLocaleList.realloc(3);
+ aLocaleList.getArray()[0] = "de-DE";
+ aLocaleList.getArray()[1] = "en-US";
+ aLocaleList.getArray()[2] = "en-GB";
+ }
+ else
+ aLinguCfg.GetLocaleListFor("GrammarCheckers",
+ "org.openoffice.lingu.LanguageToolGrammarChecker", aLocaleList);
auto nLength = aLocaleList.getLength();
m_aSuppLocales.realloc(nLength);