icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Locale of constructed object design

Open sffc opened this issue 1 year ago • 1 comments

Split from #173

The design doc submitted in https://github.com/unicode-org/icu4x/pull/1237 does not appear to address one of the original questions from #173, which is what types of getters we should expose on formatters to describe what locale they represent.

CC @mihnita

sffc avatar Jul 24 '22 06:07 sffc

I think that https://github.com/unicode-org/icu4x/issues/173 mixes 2 concerns:

  1. The getters for Requested / Valid / Actual locale
  2. The first comment in #173 (from Zibi) about Requested / Available / Last Fallback / Resolved Locales

The second one is the one addressed by the "Design doc: locale fallback and negotiation #1237"

The first one I remember being discussed in detail in a meeting. The various arguments are captured in an issue, or in some meeting notes. I will search it and will link to it, if I find it.

But the gist of my argument there was that I think that "requested" is OK and possible to implement, but "valid" and " " are basically impossible (at least impossible to give something useful).

To format something we often assemble pieces from a lot of places. Think "2-23 dollars" Mixes in numbering formatting symbols (separators, grouping rules), digit types, translation for "dollars", plural rules, currency range format pattern. And (if for example the requested locale was en-US) these might come from root, en, en-US, Latn (en -> likely subtags). For dates the first day of the week / week-end come from the country, not the full locale.

Something like actual or valid would return (maybe) a map with info for each piece. Which is (I would argue) both ugly and useless.

But this does not capture the comments other had. I will try to find the meeting notes.

mihnita avatar Aug 01 '22 18:08 mihnita

Note that we need to answer this question for the purposes of ECMA-402 resolvedOptions.

sffc avatar Feb 23 '23 02:02 sffc

Discuss in the ICU-TC call.

sffc avatar Jun 22 '23 17:06 sffc

This is mostly the same as #3906

sffc avatar Feb 29 '24 06:02 sffc