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

Need to define which option values are supported in Intl methods with null locale #2

Open
justingrant opened this issue Sep 1, 2023 · 3 comments

Comments

@justingrant
Copy link

The readme says:

The "localized" output for "und" should avoid including actually localized text in its output, such as fully written-out unit names or the names of months.

The proposal should define:

  • Which option values (or entire options) of Intl formatting methods are not supported.
  • What should happen if a user provides a not-supported option value. If the answer is "each unsupported value has a fallback value that will be used instead" then that fallback value should be defined.

I assume that options like timeZone, calendar, and fractionalSecondDigits *will* be supported because they affect the non-localized numeric values of the output. If this assumption is wrong, please explain why. Thanks!

@eemeli
Copy link
Member

eemeli commented Sep 2, 2023

First of all, I rather like null as an explicit value for this "locale", rather than a string identifier. Atm using it produces a TypeError.

Which option values (or entire options) of Intl formatting methods are not supported.

I'm not sure yet. This also depends on what's meant by "not supported": do they not have an effect on the output, or do they produce an error? I don't think any current options should necessarily produce errors, but some may not have any effect.

What should happen if a user provides a not-supported option value. If the answer is "each unsupported value has a fallback value that will be used instead" then that fallback value should be defined.

I would actually go even further, and not just define the exact behaviour for option values, but also the output that's produced.

I assume that options like timeZone, calendar, and fractionalSecondDigits will be supported because they affect the non-localized numeric values of the output. If this assumption is wrong, please explain why. Thanks!

That sounds reasonable. I'm not very familiar with other calendars than Gregorian; do others also have standardised ways of displaying dates?

@justingrant
Copy link
Author

First of all, I rather like null as an explicit value for this "locale", rather than a string identifier. Atm using it produces a TypeError.

Oh, interesting. I opened #5 for this idea.

I was actually just using null colloquially to refer to this locale. I'm not convinced that this is the right term for it unless #5 is accepted, which I'm undecided is a good idea or not. If #5 is not accepted, then I think we should pick another name. See #6.

I would actually go even further, and not just define the exact behaviour for option values, but also the output that's produced.

Agreed. For Intl.DTF formats in this proposal's locale, one possibility would be to align to Temporal objects' toString output. I opened #7 to discuss.

@justingrant
Copy link
Author

I assume that options like timeZone, calendar, and fractionalSecondDigits will be supported because they affect the non-localized numeric values of the output. If this assumption is wrong, please explain why. Thanks!

That sounds reasonable. I'm not very familiar with other calendars than Gregorian; do others also have standardised ways of displaying dates?

After thinking about it, I'm not sure that supporting the calendar option would be a good idea or not. See #9 to discuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants