lingucomponent/source/lingutil/lingutil.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 376aded127cd5c9030c3b52fd2095c4241abc053
Author:     Khaled Hosny <kha...@libreoffice.org>
AuthorDate: Wed Jun 7 17:43:13 2023 +0300
Commit:     خالد حسني <kha...@libreoffice.org>
CommitDate: Sat Jun 10 17:19:51 2023 +0200

    tdf#64830: Don’t require hunspell dictionary for every Arabic locale
    
    For old-style hunspell dictionaries, if “ar” dictionary is found, add
    the rest of Arabic locales for that dictionary’s aLocaleNames, so that
    distributions don’t have to symlink the dictionary files.
    
    This is similar to the fix for macOS spell checking in:
    
    Author: Khaled Hosny <kha...@aliftype.com>
    Date:   Tue Feb 7 21:29:12 2023 +0200
    
        tdf#153436: Improve handling of Arabic system spell dictionary on macOS
    
    Change-Id: I96b23566cba7b345a10e10c10f1bfe02ce1f8cf3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152706
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@libreoffice.org>
    (cherry picked from commit 2940fb7d2aba063441e7ce70bb276bfe912ed73e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152822

diff --git a/lingucomponent/source/lingutil/lingutil.cxx 
b/lingucomponent/source/lingutil/lingutil.cxx
index 5e931f894ad2..e5ea427eda1c 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -121,8 +121,18 @@ static void GetOldStyleDicsInDir(
                 // add the dictionary to the resulting vector
                 SvtLinguConfigDictionaryEntry aDicEntry;
                 aDicEntry.aLocations = { sPath };
-                aDicEntry.aLocaleNames = { aLocaleName };
                 aDicEntry.aFormatName = aFormatName;
+                if (aLocaleName == u"ar")
+                    aDicEntry.aLocaleNames = {
+                        aLocaleName,
+                        u"ar-AE", u"ar-BH", u"ar-DJ", u"ar-DZ", u"ar-EG",
+                        u"ar-ER", u"ar-IL", u"ar-IQ", u"ar-JO", u"ar-KM",
+                        u"ar-KW", u"ar-LB", u"ar-LY", u"ar-MA", u"ar-MR",
+                        u"ar-OM", u"ar-PS", u"ar-QA", u"ar-SA", u"ar-SD",
+                        u"ar-SO", u"ar-SY", u"ar-TD", u"ar-TN", u"ar-YE"
+                    };
+                else
+                    aDicEntry.aLocaleNames = { aLocaleName };
                 aRes.push_back( aDicEntry );
             }
         }

Reply via email to