-
Notifications
You must be signed in to change notification settings - Fork 106
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
Comments
Does this apply to other things, such as NumberFormat and DateFormat, as well? |
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. |
+1 to this feature from an internal client. The client is using Closure Templates and goog.i18n.DateTimeFormat to format dates. They reported:
internal cross-reference: http://yaqs/eng/q/5813676027281408 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 |
In this case, let's consider which parts of display context might be handled by a separate title case proposal. |
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. |
@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? |
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
The text was updated successfully, but these errors were encountered: