lingucomponent/source/spellcheck/macosxspell/macspellimp.mm |   14 +++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 9d44236a62bf59d120dda89924d0d1407b2bd52b
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Tue Feb 7 21:29:12 2023 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Tue Feb 7 22:01:07 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/+/146641
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@aliftype.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" );
             }

Reply via email to