From 5bec6b86cb08b814076f4bf51aee1547f13b61ec Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 11 Aug 2018 00:23:25 +0200 Subject: tdf#119117: get phonebook sort work by tweaking ICU call mechanism Using "phonebook" as variant does't work with de_DE since it gives de_DE_PHONEBOOK whereas icu expects de__PHONEBOOK See http://userguide.icu-project.org/locale#TOC-Variant-code, Level 2 canonicalization, 8. So let variant empty and use the fourth arg of icuLocale "keywords" See constructors in http://icu-project.org/apiref/icu4c/classicu_1_1Locale.html Change-Id: I6c216c86cdd32abfa477c14a80d1b8794b536900 Reviewed-on: https://gerrit.libreoffice.org/58870 (cherry picked from commit 13db6e8671c36e1a028d6a8ad63f518e60f84870) Reviewed-on: https://gerrit.libreoffice.org/59278 Tested-by: Jenkins Reviewed-by: Eike Rathke --- include/i18nlangtag/languagetagicu.hxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/i18nlangtag/languagetagicu.hxx b/include/i18nlangtag/languagetagicu.hxx index 2d0aabdd34ea..e2c9f7ce2b0e 100644 --- a/include/i18nlangtag/languagetagicu.hxx +++ b/include/i18nlangtag/languagetagicu.hxx @@ -41,13 +41,12 @@ public: /** Obtain language tag as ICU icu::Locale, adding variant data. From the LanguageTag only language and country are used to construct - the icu:Locale, the variant field is copied from rVariant. For example - needed to create an icu::Collator instance where the variant field - denotes the algorithm to be used. + the icu:Locale, the variant field is copied from rVariant. + The 4th arg of icu::Locale "keywords" (eg: for collation) Always resolves an empty tag to the system locale. */ - static icu::Locale getIcuLocale( const LanguageTag & rLanguageTag, const OUString & rVariant ); + static icu::Locale getIcuLocale( const LanguageTag & rLanguageTag, const OUString & rVariant, const OUString & rKeywords); }; #endif // INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX -- cgit