lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 14 +++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
New commits: commit a897987a01fe8779f3fc0efb36b1c58ca01bd710 Author: Khaled Hosny <kha...@aliftype.com> AuthorDate: Tue Feb 7 21:29:12 2023 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Wed Feb 8 03:30:13 2023 +0000 tdf#153436: Improve handling of Arabic system spell dictionary on macOS The system has only a generic “ar” spell dictionary, but LibreOffice wants country code as well. Since it is the same dictionary for all Arabic locales, we now add entries to all Arabic country codes we know about. Change-Id: Iaf5a8f495b3d1023d7fe40654afa0cce3fe9fbdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146616 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm index c20871b1e127..448870e9125c 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm @@ -125,7 +125,19 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales() // Fix up generic languages (without territory code) and odd combinations that LO // doesn't handle. - if ([pLangStr isEqualToString:@"da"]) + if ([pLangStr isEqualToString:@"ar"]) + { + const std::vector<NSString*> aAR + { @"AE", @"BH", @"DJ", @"DZ", @"EG", @"ER", @"IL", @"IQ", @"JO", + @"KM", @"KW", @"LB", @"LY", @"MA", @"MR", @"OM", @"PS", @"QA", + @"SA", @"SD", @"SO", @"SY", @"TD", @"TN", @"YE" }; + for (auto c: aAR) + { + pLangStr = [@"ar_" stringByAppendingString: c]; + postspdict.push_back( pLangStr ); + } + } + else if ([pLangStr isEqualToString:@"da"]) { postspdict.push_back( @"da_DK" ); }