mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-2202 getLocale implementation for rule based number format
X-SVN-Rev: 13807
This commit is contained in:
parent
73e1d793e7
commit
91d46c9250
2 changed files with 8 additions and 2 deletions
|
@ -88,6 +88,8 @@ RuleBasedNumberFormat::RuleBasedNumberFormat(URBNFRuleSetTag tag, const Locale&
|
|||
UResourceBundle* nfrb = ures_open(NULL, locale.getName(), &status);
|
||||
// UResourceBundle* yuck = ures_getByKey(nfrb, fmt_tag, NULL, &status);
|
||||
// const UChar* description = ures_getString(yuck, &len, &status);
|
||||
uprv_strcpy(validLocale, ures_getLocaleByType(nfrb, ULOC_VALID_LOCALE, &status));
|
||||
uprv_strcpy(actualLocale, ures_getLocaleByType(nfrb, ULOC_ACTUAL_LOCALE, &status));
|
||||
const UChar* description = ures_getStringByKey(nfrb, fmt_tag, &len, &status);
|
||||
if (U_SUCCESS(status)) {
|
||||
UnicodeString desc(description, len);
|
||||
|
@ -452,6 +454,9 @@ RuleBasedNumberFormat::init(const UnicodeString& rules, UParseError& pErr, UErro
|
|||
return;
|
||||
}
|
||||
|
||||
validLocale[0] = 0;
|
||||
actualLocale[0] = 0;
|
||||
|
||||
UnicodeString description(rules);
|
||||
if (!description.length()) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
|
|
|
@ -671,11 +671,12 @@ private:
|
|||
static const int32_t fgMaxIntegerDigits;
|
||||
static const int32_t fgMinIntegerDigits;
|
||||
|
||||
private:
|
||||
|
||||
protected:
|
||||
char validLocale[50];
|
||||
char actualLocale[50];
|
||||
|
||||
private:
|
||||
|
||||
enum EStyles {
|
||||
kNumberStyle,
|
||||
kCurrencyStyle,
|
||||
|
|
Loading…
Add table
Reference in a new issue