Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DisplayContext #355

Open
sffc opened this issue Jun 4, 2019 · 13 comments
Open

Add support for DisplayContext #355

sffc opened this issue Jun 4, 2019 · 13 comments
Labels
c: text Component: case mapping, collation, properties Proposal Larger change requiring a proposal s: help wanted Status: help wanted; needs proposal champion

Comments

@sffc
Copy link
Contributor

sffc commented Jun 4, 2019

ICU has a concept called "DisplayContext", which controls the capitalization rules for display names, dates, and numbers. We should consider adding support for this across ECMA 402.

Discussion with regard to Intl.DisplayNames: tc39/proposal-intl-displaynames#13

@littledan
Copy link
Member

Does this apply to other things, such as NumberFormat and DateFormat, as well?

@sffc
Copy link
Contributor Author

sffc commented Jun 25, 2019

The short answer is yes; the casing, mood, etc., of all types of formatted output might depend on the context in which the output is displayed.

This feature will require investigating the variables that could affect formatted output, and then adding the option/options across most Intl formatters. We may also want to consider making this more of a first-class feature such that developers don't overlook it. Ideally, any call site to an affected formatter will declare its display context.

@sffc
Copy link
Contributor Author

sffc commented Sep 23, 2019

@younies @hugovdm This could be something to consider along with the inflections work you are doing ("Project Morpheus").

@sffc
Copy link
Contributor Author

sffc commented Mar 17, 2020

+1 to this feature from an internal client. The client is using Closure Templates and goog.i18n.DateTimeFormat to format dates. They reported:

During the localization testing, we found that the months are not capitalized in NL, PL and FR. ... Our linguist says that even though the months in these languages should not be capitalized when they appear within a sentence, they should be capitalized when they appear stand-alone in a list, where other words are capitalized.

internal cross-reference: http://yaqs/eng/q/5813676027281408

@zbraniecki

This comment has been minimized.

@sffc

This comment has been minimized.

@zbraniecki

This comment has been minimized.

@sffc

This comment has been minimized.

@zbraniecki
Copy link
Member

During the localization testing, we found that the months are not capitalized in NL, PL and FR. ... Our linguist says that even though the months in these languages should not be capitalized when they appear within a sentence, they should be capitalized when they appear stand-alone in a list, where other words are capitalized.

Interesting. I can only speak for Polish but I'd challenge that linguist. In Polish, names of months are always not capitalized. Standalone and in the middle of the sentence. They should only be capitalized at the beginning of a sentence.

That, of course, may be different for other affected locales and doesn't discount the value of displayContext - just pointing out that standalone/sentence is not all, we'll likely need at least standalone/middle-of-the-sentence/beginning-of-the-sentence.

@littledan
Copy link
Member

In this case, let's consider which parts of display context might be handled by a separate title case proposal.

@sffc
Copy link
Contributor Author

sffc commented May 2, 2020

The main problem that DisplayContext solves is that which capitalization scheme to apply is function- and locale-dependent. For example, in some locales, you might titlecase month names, but in other locales, you display them in lowercase.

@macchiati has been a big advocate for using DisplayContext more universally across the board, and bubbling it through the hierarchy of formatters.

@littledan
Copy link
Member

@sffc This seems important to understand. I'm missing background in this area. Do you have any recommendations for where to read about the motivation for this effort, and why it doesn't "decompose" into case conversion routines?

@sffc
Copy link
Contributor Author

sffc commented Oct 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: text Component: case mapping, collation, properties Proposal Larger change requiring a proposal s: help wanted Status: help wanted; needs proposal champion
Projects
None yet
Development

No branches or pull requests

3 participants