summaryrefslogtreecommitdiff
path: root/i18nutil
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-22 12:57:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-22 12:57:07 +0000
commit486e318b86943844011ef881556dabb4a3f7ef33 (patch)
tree8bc7ea6fa37e0a03e6dddada09da339d195a5f44 /i18nutil
parent3b0cf674925dd8fd0f34c5a810afc470ce5b4a0f (diff)
CLDR Version 24 doesn't know about es and sl using space before %
Change-Id: I1c3e7dc28e389a9580239165d04b171e06f5618e
Diffstat (limited to 'i18nutil')
-rw-r--r--i18nutil/source/utility/unicode.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 5ef4fb54423e..ff928053d8c2 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -945,7 +945,18 @@ OUString SAL_CALL unicode::formatPercent(double dNumber,
{
// get a currency formatter for this locale ID
UErrorCode errorCode=U_ZERO_ERROR;
- icu::Locale aLocale = LanguageTagIcu::getIcuLocale(rLangTag);
+
+ LanguageTag aLangTag(rLangTag);
+
+ // As of CLDR Version 24 these languages were not listed as using spacing
+ // between number and % but are reported as such by our l10n groups
+ // http://www.unicode.org/cldr/charts/24/by_type/numbers.number_formatting_patterns.html
+ // so format using French which has the desired rules
+ if (aLangTag.getLanguage() == "es" || aLangTag.getLanguage() == "sl")
+ aLangTag = LanguageTag("fr-FR");
+
+ icu::Locale aLocale = LanguageTagIcu::getIcuLocale(aLangTag);
+
boost::scoped_ptr<NumberFormat> xF(
NumberFormat::createPercentInstance(aLocale, errorCode));
if(U_FAILURE(errorCode))