Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: source/i18n/locdspnm.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/islamcal.cpp ('k') | source/i18n/measfmt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/locdspnm.cpp
diff --git a/source/i18n/locdspnm.cpp b/source/i18n/locdspnm.cpp
index 65ac4a3d90cd8a08335fd0d3042286dea1cd21e0..c0934cd5dc816b6205736c4fe593138312d7d613 100644
--- a/source/i18n/locdspnm.cpp
+++ b/source/i18n/locdspnm.cpp
@@ -688,7 +688,7 @@ UnicodeString&
LocaleDisplayNamesImpl::localeIdName(const char* localeId,
UnicodeString& result) const {
if (nameLength == UDISPCTX_LENGTH_SHORT) {
- langData.getNoFallback("LanguagesShort", localeId, result);
+ langData.getNoFallback("Languages%short", localeId, result);
if (!result.isBogus()) {
return result;
}
@@ -703,7 +703,7 @@ LocaleDisplayNamesImpl::languageDisplayName(const char* lang,
return result = UnicodeString(lang, -1, US_INV);
}
if (nameLength == UDISPCTX_LENGTH_SHORT) {
- langData.get("LanguagesShort", lang, result);
+ langData.get("Languages%short", lang, result);
if (!result.isBogus()) {
return adjustForUsageAndContext(kCapContextUsageLanguage, result);
}
@@ -735,7 +735,7 @@ UnicodeString&
LocaleDisplayNamesImpl::regionDisplayName(const char* region,
UnicodeString& result) const {
if (nameLength == UDISPCTX_LENGTH_SHORT) {
- regionData.get("CountriesShort", region, result);
+ regionData.get("Countries%short", region, result);
if (!result.isBogus()) {
return adjustForUsageAndContext(kCapContextUsageTerritory, result);
}
@@ -764,6 +764,23 @@ UnicodeString&
LocaleDisplayNamesImpl::keyValueDisplayName(const char* key,
const char* value,
UnicodeString& result) const {
+ if (uprv_strcmp(key, "currency") == 0) {
+ // ICU4C does not have ICU4J CurrencyDisplayInfo equivalent for now.
+ UErrorCode sts = U_ZERO_ERROR;
+ UnicodeString ustrValue(value, -1, US_INV);
+ int32_t len;
+ UBool isChoice = FALSE;
+ const UChar *currencyName = ucurr_getName(ustrValue.getTerminatedBuffer(),
+ locale.getBaseName(), UCURR_LONG_NAME, &isChoice, &len, &sts);
+ if (U_FAILURE(sts)) {
+ // Return the value as is on failure
+ result = ustrValue;
+ return result;
+ }
+ result.setTo(currencyName, len);
+ return adjustForUsageAndContext(kCapContextUsageKeyValue, result);
+ }
+
if (nameLength == UDISPCTX_LENGTH_SHORT) {
langData.get("Types%short", key, value, result);
if (!result.isBogus()) {
« no previous file with comments | « source/i18n/islamcal.cpp ('k') | source/i18n/measfmt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698