ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Support returning region display names with article as needed

Open lucacasonato opened this issue 2 months ago • 3 comments

When using the name of a country in a sentence, some countries need to be prefixed with an article in English:

Are you based in ${country}?

If you format NL (= Netherlands) into this sentence, you need to actually write the Netherlands, because of reasons. The same reason requires you to write US (= United States) or UK (= United Kingdom) as the United States or the United Kingdom.

Most countries do not require the prefix though, such as DE (= Germany) or IT (= Italy).

This is not just the case in English, but also in German or Dutch.

Reis jij naar Nederland?
Reis jij naar de Verenigde Staten?
Reis jij naar het Verenigd Koninkrijk?
Reis jij naar Duitsland?
Reis jij naar Italië?
Die Niederlande ist schön. / Kommt ihr aus den Niederlanden?
Die Vereinigten Staaten sind schön. / Kommt ihr aus den Vereinigten Staaten?
Das Vereinigten Königreich ist schön. / Kommt ihr aus dem Vereinigten Königreich?
Deutschland ist schön. / Kommt ihr aus Deutschland?
Italien ist schön. / Kommt ihr aus Italien?

The reason for this is that some of these country names are actually plurals, and because of that need an article when used in a sentence.

It does get even more difficult thoughm, because in some languages, the article depends on the position of the noun in the sentence (e.g in German, where the entire word and article are different in nominative vs dative for NL).

Has anyone thought about this in the past? It would be awesome if Intl.DisplayNames could handle this reasonably well.

lucacasonato avatar Oct 15 '25 17:10 lucacasonato

Related: https://github.com/tc39/ecma402/issues/355

I agree that we should add more context to Intl.DisplayNames, which currently is useful in dropdown menus but not really in natural language as you pointed out. Any effort here should start in CLDR.

sffc avatar Oct 15 '25 20:10 sffc

Rather than only delegating this to CLDR, I do think it'd be appropriate for us to consider whether ECMA402 ought to implement such an extension of Intl.DisplayNames and therefore be an interested client for such data, if it were available.

My own suspicion is that the payload size of the added strings isn't worth it for this, though that may be influenced by knowing that for Finnish, we'd want at least the following cases to be available (continuing with Netherlands as an example):

  • nominative: Alankomaat
  • ablative: Alankomailta
  • elative: Alankomaista
  • genitive: Alankomaiden
  • illative: Alankomaihin
  • inessive: Alankomaissa

eemeli avatar Oct 16 '25 06:10 eemeli

Yeah, as always, start with the use case to decide how much of that we want to ship.

sffc avatar Oct 16 '25 07:10 sffc