diff --git a/config_host/config_locales.h.in b/config_host/config_locales.h.in index b9b6988cc891..18d3f041dbc5 100644 --- a/config_host/config_locales.h.in +++ b/config_host/config_locales.h.in @@ -38,8 +38,8 @@ #define WITH_LOCALE_hu 0 #define WITH_LOCALE_is 0 #define WITH_LOCALE_ja 0 +#define WITH_LOCALE_kmr_Latn 0 #define WITH_LOCALE_ko 0 -#define WITH_LOCALE_ku 0 #define WITH_LOCALE_ln 0 #define WITH_LOCALE_my 0 #define WITH_LOCALE_ne 0 diff --git a/i18npool/CustomTarget_collator.mk b/i18npool/CustomTarget_collator.mk index 0364d9291498..cdff2740f32a 100644 --- a/i18npool/CustomTarget_collator.mk +++ b/i18npool/CustomTarget_collator.mk @@ -26,8 +26,8 @@ i18npool_COTXTS := \ $(call gb_Helper_optional_locale,ko, \ ko_charset.txt) \ ) \ - $(call gb_Helper_optional_locale,ku, \ - ku_alphanumeric.txt) \ + $(call gb_Helper_optional_locale,kmr_Latn, \ + kmr_Latn_alphanumeric.txt) \ $(call gb_Helper_optional_locale,ln, \ ln_charset.txt) \ $(call gb_Helper_optional_locale,my, \ diff --git a/i18npool/inc/collator_unicode.hxx b/i18npool/inc/collator_unicode.hxx index 4b788826350e..3612d372cf72 100644 --- a/i18npool/inc/collator_unicode.hxx +++ b/i18npool/inc/collator_unicode.hxx @@ -79,8 +79,8 @@ extern "C" { const sal_uInt8* get_collator_data_ja_charset(); const sal_uInt8* get_collator_data_ja_phonetic_alphanumeric_first(); const sal_uInt8* get_collator_data_ja_phonetic_alphanumeric_last(); + const sal_uInt8* get_collator_data_kmr_Latn_alphanumeric(); const sal_uInt8* get_collator_data_ko_charset(); - const sal_uInt8* get_collator_data_ku_alphanumeric(); const sal_uInt8* get_collator_data_ln_charset(); const sal_uInt8* get_collator_data_my_dictionary(); const sal_uInt8* get_collator_data_ne_charset(); @@ -102,8 +102,8 @@ extern "C" { size_t get_collator_data_ja_charset_length(); size_t get_collator_data_ja_phonetic_alphanumeric_first_length(); size_t get_collator_data_ja_phonetic_alphanumeric_last_length(); + size_t get_collator_data_kmr_Latn_alphanumeric_length(); size_t get_collator_data_ko_charset_length(); - size_t get_collator_data_ku_alphanumeric_length(); size_t get_collator_data_ln_charset_length(); size_t get_collator_data_my_dictionary_length(); size_t get_collator_data_ne_charset_length(); diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index b646485ad824..1ae5508de627 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -81,10 +81,21 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: throw RuntimeException(message); } } - if (!collator && OUString(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) { - const sal_uInt8* (*func)() = nullptr; - size_t (*funclen)() = nullptr; + const sal_uInt8* (*func)() = nullptr; + size_t (*funclen)() = nullptr; + bool bKmrLatn = false; + +#if WITH_LOCALE_ALL || WITH_LOCALE_kmr_Latn + // tdf#173547: specific case for Kurdish Latin (it could be "kmr-Latn-TR" but also "kmr-Latn-SY") + bKmrLatn = rLocale.Language == "qlt" && rLocale.Variant.startsWith("kmr-Latn") && rAlgorithm == "alphanumeric"; + if (bKmrLatn) { + func = get_collator_data_kmr_Latn_alphanumeric; + funclen = get_collator_data_kmr_Latn_alphanumeric_length; + } +#endif + + if (!collator && (OUString(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0 || bKmrLatn)) { if (false) { ; #if WITH_LOCALE_ALL || WITH_LOCALE_ca @@ -138,14 +149,6 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: funclen = get_collator_data_ja_phonetic_alphanumeric_last_length; } #endif -#if WITH_LOCALE_ALL || WITH_LOCALE_ku - } else if ( rLocale.Language == "ku" ) { - if ( rAlgorithm == "alphanumeric" ) - { - func = get_collator_data_ku_alphanumeric; - funclen = get_collator_data_ku_alphanumeric_length; - } -#endif #if WITH_LOCALE_ALL || WITH_LOCALE_ln } else if ( rLocale.Language == "ln" ) { if ( rAlgorithm == "charset" ) diff --git a/i18npool/source/collator/data/ku_alphanumeric.txt b/i18npool/source/collator/data/kmr_Latn_alphanumeric.txt similarity index 100% rename from i18npool/source/collator/data/ku_alphanumeric.txt rename to i18npool/source/collator/data/kmr_Latn_alphanumeric.txt