date input calendar layout problem in portuguese (pt-PT only)
Categories
(Core :: Layout: Form Controls, defect, P3)
Tracking
()
People
(Reporter: alexandre, Unassigned)
Details
Attachments
(1 file)
|
96.60 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
Create a date input.
(tried on 67.0, 67.0b12 and 68.0b5 on mac os 10.14.5). Firefox interface should be set to Portuguese.
Actual results:
Weekdays show in full (domingo, segunda...) instead of abbreviated (dom seg...) This causes overlap in weekdays text and breaks the layout making text overlap and scrollbars to appear. In 68b5 scrollbars are gone but weekdays are still in full and overlaping.
Expected results:
I expected weekdays to show as (dom, seg, ter, qua, qui, sex, sab)
If interface is in english, french or german weekdays always appear abreviated.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
The priority flag is not set for this bug.
:jfkthame, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•6 years ago
|
||
This seems to be how the "short" weekday names are specified in the pt-PT locale; on the other hand, pt-BR (or just pt with no region subtag) uses the shorter form:
var d = new Date()
undefined
d.toLocaleDateString("pt", {weekday:"short"})
"qui"
d.toLocaleDateString("pt-BR", {weekday:"short"})
"qui"
d.toLocaleDateString("pt-PT", {weekday:"short"})
"quinta"
This comes from the abbreviated day-name data in CLDR; see the rightmost column at https://www.unicode.org/cldr/charts/latest/summary/pt.html#1805, where the "pt_PT" sublocale overrides the default (shorter) form found in "pt".
It's unclear to me what we should be doing here: should the date picker use a more flexible layout where the columns spread as necessary for these longer day names, or should we detect if the names are too long to fit, and switch to a shorter form? (Is the CLDR "short" form, as opposed to the "abbreviated" one, exposed to JS in such a way that we could even use it here?)
Zibi, any thoughts on how we should deal with this?
Comment 3•6 years ago
|
||
I think the reporter should file an issue in CLDR [0] reporting that short version of the weekday in pt-PT is wrong.
Comment 4•6 years ago
|
||
(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #3)
I think the reporter should file an issue in CLDR [0] reporting that short version of the weekday in pt-PT is wrong.
Beware of terminology confusion here. Note that this isn't the short version per CLDR, it's the abbreviated weekday, which is exposed as short in toLocaleDateString. The form that CLDR gives as short is the 3-letter version the reporter expected here.
For pt-PT, CLDR has:
wide: domingo, segunda-feira, terça-feira, ...
abbreviated: domingo, segunda, terça, ...
short: dom, seg, ter, ...
narrow: D, S, T, ...
So the abbreviated form clearly is a legitimate abbreviation of the full form, dropping the "-feira" suffixes, and presumably (given that it has been specifically entered as a variation from the region-free pt data) has a use case. I suspect it's been this way in CLDR and other globalization resources for many years, and is unlikely to change.
I see that according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat, the JS Intl API provides three options for weekday, long, short, and narrow. That doesn't map cleanly to the CLDR data, where there are four options, wide, abbreviated, short, and narrow. We're having this issue because Intl's short is mapped to CLDR's abbreviated. Maybe that needs to be reconsidered.
Comment 5•6 years ago
|
||
What we do is we format month: short as MMM [0], and that in CLDR is abbreviated [1].
[0] https://searchfox.org/mozilla-central/source/js/src/builtin/intl/DateTimeFormat.js#570
[1] https://unicode.org/reports/tr35/tr35-dates.html#dfst-month
I'd question if segunda is expected to be seen as abreviated here. Also, it seems that CLDR doesn't provide a date skeleton variant for month short.
Comment 6•6 years ago
|
||
This isn't about month, it's about weekday, for which EEEEEE would give the short format [1]. So if we decided to change, we could use that at [2].
(FWIW, when I look at the Date/Time preference panel in macOS System Preferences, it's using what look like short (rather than abbreviated) weekday forms for English: Su, Mo, Tu, etc.)
[1] https://unicode.org/reports/tr35/tr35-dates.html#dfst-weekday
[2] https://searchfox.org/mozilla-central/rev/1133b6716d9a8131c09754f3f29288484896b8b6/js/src/builtin/intl/DateTimeFormat.js#536
Comment 7•6 years ago
|
||
Checking Date.toLocaleDateString in Chrome, I see that it uses the same short weekdays as Firefox, so for today's date the "pt" locale gives "sex", but "pt-PT" gives "sexta". OTOH, when I set my system to pt-PT, its date picker still uses the shorter form. (Of course, their date picker may not be implemented on top of the JS Intl API at all...)
Comment 8•6 years ago
|
||
The priority flag is not set for this bug.
:dbaron, could you have a look please?
For more information, please visit auto_nag documentation.
| Reporter | ||
Comment 9•6 years ago
|
||
As suggested added a bug report in https://unicode-org.atlassian.net/browse/CLDR-13106
IMHO PT_pt at CLDR abbreviated seems correct as "segunda, terça..." as weekdays since the denomination is (segunda-feira, terça-feira...), but short (seg, ter) is probably more appropriate in the calendar since it better fits the calendar grid.
Comment 10•6 years ago
|
||
V8 uses the same EEE for weekday: short as we do: https://github.com/v8/v8/blob/master/src/objects/js-date-time-format.cc#L69
Seems like we could just work around the underlying CLDR data by forcing pt-PT to use the pt or pt-BR data just for the datepicker. Would that be too difficult? Or do we want to fix the underlying data somehow?
Comment 12•6 years ago
|
||
I'm generally afraid of one-off solutions because they scale and bitrot very badly.
We talked about adding data overlay for CLDR for quite a while. That's something that the L10n team would very much like to have (CC'ing Flod), but I don't know if that has been prioritized anywhere.
Comment 13•6 years ago
|
||
Hate to do this on a bug with conversations, but the bug is already on file (on our side and other places).
https://unicode-org.atlassian.net/browse/CLDR-10859
http://bugs.icu-project.org/trac/ticket/13592
| Reporter | ||
Comment 14•3 years ago
|
||
Just as a status update this is being fixed at unicode side https://unicode-org.atlassian.net/browse/CLDR-13106?focusedCommentId=164176
Description
•