proposal: add localized rule set name support to rbnf
Doug Felt <[email protected]> Tue, 13 Jul 2004 17:26:20 -0700 (PDT)
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <[email protected]> |
Please respond by July 27.
This proposal is for API to support jb#3634 "RBNF rule sets should have
localized display names."
I'm proposing to add the following API to RuleBasedNumberFormat. C++ API will
be similar. Not sure about C API yet.
Two constructors have new overloads, to pass in the display name information,
and two new APIs are provided to return the list of locales for which there is
rule set display name information, and to return the list of localized rule set
names. The default behavior for locales that do not have this information will
be to trim off the '%' from the existing 'internal' rule set names and return
that.
(1) Overload of existing constructor.
/**
* Creates a RuleBasedNumberFormat that behaves according to the
description
* passed in. The formatter uses the default locale.
* @param description A description of the formatter's desired behavior.
* See the class documentation for a complete explanation of the
description
* syntax.
* @param a list of localizations for the rule set names in the
description.
* Each element is an array or strings. The first string is the ulocale,
the
* remainder are the localizations of the public rule set names, in reverse
* order from how they they appear in the description.
* @draft ICU 3.2
* @deprecated This is a draft API and might change in a future release of
ICU.
*/
public RuleBasedNumberFormat(String description, String[][] localizations);
(2) Overload of existing constructor.
/**
* Creates a RuleBasedNumberFormat that behaves according to the
description
* passed in. The formatter uses the specified locale to determine the
* characters to use when formatting in numerals, and to define
equivalences
* for lenient parsing.
* @param description A description of the formatter's desired behavior.
* See the class documentation for a complete explanation of the
description
* syntax.
* @param a list of localizations for the rule set names in the
description.
* Each element is an array or strings. The first string is the ulocale,
the
* remainder are the localizations of the public rule set names, in reverse
* order from how they appear in the description.
* @param locale A locale, which governs which characters are used for
* formatting values in numerals, and which characters are equivalent in
* lenient parsing.
* @draft ICU 3.2
* @deprecated This is a draft API and might change in a future release of
ICU.
*/
public RuleBasedNumberFormat(String description, String[][] localizations,
Locale locale)
(3) New API.
/**
* Return a list of locales for which there are locale-specific display
names
* for the rule sets in this formatter. If there are no localized display
names, return null.
* @return an array of the locales for which there is rule set display name
information
* @draft ICU 3.2
* @deprecated This is a draft API and might change in a future release of
ICU.
*/
public ULocale[] getRuleSetDisplayNameLocales();
(4) New API.
/**
* Return the rule set display names for the provided locale. These are in
the same order
* as those returned by getRuleSetNames. The locale is matched against the
locales for
* which there is display name data, using normal fallback rules. If no
locale matches
* the default display names are returned. (These are the internal rule
set names minus
* the leading '%'.)
* @return an array of the locales that have display name information
* @draft ICU 3.2
* @see #getRuleSetNames
* @deprecated This is a draft API and might change in a future release of
ICU.
*/
public String[] getRuleSetDisplayNames(ULocale locale)
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail