summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/localedata/data/en_US.xml24
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx18
2 files changed, 41 insertions, 1 deletions
diff --git a/i18npool/source/localedata/data/en_US.xml b/i18npool/source/localedata/data/en_US.xml
index 9e852f743125..14c74a7e2932 100644
--- a/i18npool/source/localedata/data/en_US.xml
+++ b/i18npool/source/localedata/data/en_US.xml
@@ -77,6 +77,18 @@
<FormatElement msgid="FixedFormatskey8" default="false" type="medium" usage="FIXED_NUMBER" formatindex="81">
<FormatCode>#,##0.00_);(#,##0.00)</FormatCode>
</FormatElement>
+ <FormatElement msgid="FixedFormatskey9" default="false" type="medium" usage="FIXED_NUMBER" formatindex="101">
+ <FormatCode>[NatNum12 cardinal]0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey10" default="false" type="medium" usage="FIXED_NUMBER" formatindex="102">
+ <FormatCode>[NatNum12 capitalize cardinal]0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey11" default="false" type="medium" usage="FIXED_NUMBER" formatindex="103">
+ <FormatCode>[NatNum12 title cardinal]0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey12" default="false" type="medium" usage="FIXED_NUMBER" formatindex="104">
+ <FormatCode>[NatNum12 upper cardinal]0</FormatCode>
+ </FormatElement>
<FormatElement msgid="ScientificFormatskey1" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
<FormatCode>0.00E+000</FormatCode>
</FormatElement>
@@ -116,6 +128,18 @@
<FormatElement msgid="CurrencyFormatskey8" default="false" type="medium" usage="CURRENCY" formatindex="83">
<FormatCode>[CURRENCY]* #,##0.00;-[CURRENCY]* #,##0.00</FormatCode>
</FormatElement>
+ <FormatElement msgid="CurrencyFormatskey9" default="false" type="medium" usage="CURRENCY" formatindex="105">
+ <FormatCode>[NatNum12 title CURRENCY]0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey10" default="false" type="medium" usage="CURRENCY" formatindex="106">
+ <FormatCode>[NatNum12 title CURRENCY]0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey11" default="false" type="medium" usage="CURRENCY" formatindex="107">
+ <FormatCode>[NatNum12 upper CURRENCY]0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey12" default="false" type="medium" usage="CURRENCY" formatindex="108">
+ <FormatCode>[NatNum12 upper CURRENCY]0.00</FormatCode>
+ </FormatElement>
<FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18">
<FormatCode>M/D/YY</FormatCode>
</FormatElement>
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 59c38b39edde..756866ad846e 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -699,7 +699,23 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
case LOWER:
return xCharClass->toLower(aStr, 0, aStr.getLength(), aLocale);
case TITLE:
- return xCharClass->toTitle(aStr, 0, aStr.getLength(), aLocale);
+ {
+ if ( rLocale.Language == "en" )
+ {
+ // title case is common in English, so fix bugs of toTitle():
+ // not "One Dollar *And* *Twenty-two* Cents", but
+ // "One Dollar *and* *Twenty-Two* Cents".
+
+ // Add spaces after hyphens to separate the elements of the
+ // hyphenated compound words temporarily, allowing their
+ // capitalization by toTitle()
+ aStr = aStr.replaceAll("-", "- ");
+ aStr = xCharClass->toTitle(aStr, 0, aStr.getLength(), aLocale);
+ return aStr.replaceAll("- ", "-").replaceAll(" And ", " and ");
+ }
+ else
+ return xCharClass->toTitle(aStr, 0, aStr.getLength(), aLocale);
+ }
}
}
else