diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-06-07 17:43:13 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-06-07 17:56:49 +0200 |
commit | 2940fb7d2aba063441e7ce70bb276bfe912ed73e (patch) | |
tree | a454951f100f2108c9b51c4b9ab94a7ea8b9ebf9 /lingucomponent | |
parent | e0a6c730b9fc9a86ff28cc615b70d8bde1a54393 (diff) |
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 <khaled@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: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/lingutil/lingutil.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
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 ); } } |