|
From: Shane C. <sf...@go...> - 2018-02-02 23:47:40
|
One more item that I forgot to include in the first email:
*In addition, the ICU4J abstract class CurrencyDisplayNames, which can be
used to access currency data more directly, is also proposed to be
updated. I propose adding an abstract method to access narrow currency
symbols in order to be consistent with the other methods on that class.
Although this class is public and abstract, the class is documented as "not
intended for public subclassing." However, if for some reason you have
written your own subclass, this change may give you a compile error after
upgrading. Please let me know if this is a concern for you.This is the
change to CurrencyDisplayNames.java:+ /**+ * Returns the narrow
symbol for the currency with the provided ISO code.+ * If there is no
data for narrow symbol, substitutes isoCode or returns+ * null.+ *+
* @param isoCode the three-letter ISO code.+ * @return the narrow
symbol.+ * @draft ICU 61+ * @provisional This API might change or
be removed in a future release.+ */+ public abstract String
getNarrowSymbol(String isoCode);*Sincerely, Shane
On Fri, Feb 2, 2018 at 3:34 PM, Shane Carr <sf...@go...> wrote:
>
>
>
>
>
>
>
>
>
>
>
> *Dear ICU team & users,I would like to propose the following API for: ICU
> 61Please provide feedback by: 2/6/2018Designated API reviewer: AndyTicket:
> http://bugs.icu-project.org/trac/ticket/13389
> <http://bugs.icu-project.org/trac/ticket/13389>CLDR has data for both
> normal currency symbols and "narrow" currency symbols. Narrow symbols are
> sometimes shorter than normal symbols and useful when the context makes
> clear what the currency might be. For example, in en-CA, the symbol for
> USD is "US$", but the narrow symbol for USD is "$".Formatting with narrow
> currency symbols is already supported via the NumberFormatter API. I would
> like to add the getters for accessing the data to Currency.java in ICU4J
> and ucurr.h in ICU4C.Here is the change in ICU4J. This was @internal in
> 60, and now I'm proposing it as @draft:+ /**+ * Selector for
> getName() indicating the narrow currency symbol.+ * The narrow currency
> symbol is similar to the regular currency+ * symbol, but it always
> takes the shortest form: for example,+ * "$" instead of "US$" for USD
> in en-CA.+ *+ * @draft ICU 61+ * @provisional This API might
> change or be removed in a future release.+ */+ public static final
> int NARROW_SYMBOL_NAME = 3;Here is the change in ICU4C; this gets added to
> the UCurrNameStyle enum:+ /**+ * Selector for getName() indicating
> the narrow currency symbol.+ * The narrow currency symbol is similar to
> the regular currency+ * symbol, but it always takes the shortest form:
> for example,+ * "$" instead of "US$" for USD in en-CA.+ *+ *
> @draft ICU 61+ */+ UCURR_NARROW_SYMBOL_NAMEExample code that will be
> possible after these values are added:// ICU4J:currency.getName(locale,
> Currency.NARROW_SYMBOL_NAME, isChoiceFormat);//
> ICU4C:ucurr_getName(isoCode, localeName, UCURR_NARROW_SYMBOL_NAME,
> &isChoiceFormat, &len, &status);Sincerely, Shane*
>
>
|