Re: [csswg-drafts] [css-counter-styles-3] Support automatically localized counters (#7959)

The CSS Working Group just discussed `[css-counter-styles-3] Support automatically localized counters`.

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> TabAtkins: r12a do you think that this is more of a topic to be discussed or something to be introduced?<br>
&lt;emilio> r12a: we could discuss the concept, my take was similar to the ready-made counter-styles<br>
&lt;emilio> ... I'd think it'd be something that authors would define rather than something built-in<br>
&lt;emilio> ... would you like to introduce this?<br>
&lt;r12a> https://github.com/w3c/csswg-drafts/issues/7959#issuecomment-1592610379<br>
&lt;emilio> TabAtkins: somebody filed it requesting that for a few different categories we have an automatically-internationalized version<br>
&lt;emilio> ... e.g., `digits` would be `decimal` for english, french, ... but map to something else for other languages<br>
&lt;emilio> ... same for letters which could map to hiragana in japanese<br>
&lt;emilio> ... before we accepted moving counter styles into the registry this was a lot harder to do<br>
&lt;emilio> ... r12a proposed a new at-rule mapping lang to digits<br>
&lt;florian> q+<br>
&lt;emilio> ... does this sound worth pursuing<br>
&lt;miriam> ack r12a<br>
&lt;Zakim> r12a, you wanted to react to r12a<br>
&lt;emilio> r12a: the registry doesn't really need to enter into it in the registry<br>
&lt;emilio> s/to it in the registry//<br>
&lt;emilio> ... needs to work with author styles<br>
&lt;emilio> ... just a clarification<br>
&lt;emilio> jensimmons: I really like this idea<br>
&lt;TabAtkins> My thought was just that, since we'd be supporting a ton of these, we'd also have a UA stylesheet registry with a bunch assigned. Authors would still be able to extend/override it.<br>
&lt;emilio> ... so many languages have translations<br>
&lt;TabAtkins> q+<br>
&lt;emilio> ... so even if they are not published in different languages<br>
&lt;emilio> ... I'd love for it to be in some ua default<br>
&lt;TabAtkins> (i'm just gonna say that this was noted as actaully being helpful for Wikipedia; they currently manually set a bunch of counter styles for the different translations)<br>
&lt;emilio> ... but if it can't be it'd probably end up in some kind of reset/framework sheet<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/7959#issuecomment-1592298287<br>
&lt;emilio> fantasai: there's some complications here<br>
&lt;miriam> ack fantasai<br>
&lt;emilio> ... see linked comment<br>
&lt;emilio> ... (a) you don't always want to translate the counter style, e.g. western digits might be used in other languages<br>
&lt;emilio> ... (b) some languages have multiple styles which might be designer-preference or so<br>
&lt;emilio> ... so I'm skeptic of adding something built-in<br>
&lt;emilio> ... it'd be relatively straight-forward to do this using `:lang()`<br>
&lt;emilio> ... what we don't have is a way to set a default counter-style for the counters function<br>
&lt;emilio> ... if we have that e.g. via a `counter-style` property then it'd be really easy to make this mapping<br>
&lt;miriam> ack florian<br>
&lt;TabAtkins> "relatively straightforward" is still hundreds of selectors, fwiw<br>
&lt;fantasai> s/mapping/mapping in the stylesheet/<br>
&lt;emilio> florian: I'm nervous, I' really like the vision of the international way, but this makes me nervous because it heightens the worry of the previous issue<br>
&lt;TabAtkins> and there are two types at least - numeric and writing - so a default counter() style won't satisfy it<br>
&lt;emilio> ... if you copy and paste it you check they're right, if you turn them on you likely at least checked<br>
&lt;emilio> ... it increases the chances of a wrong counter style appearing in the page if you need to do neither<br>
&lt;emilio> ... other concern is getting the mapping wrong<br>
&lt;emilio> ... e.g., japanese might not want to automatically switch to hiragana, I don't think it should be default<br>
&lt;r12a> q+<br>
&lt;emilio> ... if we were doing a couple or ten languages then we can probably figure it out<br>
&lt;fantasai> s/default/default, that would be jarring/<br>
&lt;emilio> ... but if we want hundreds, how often would we get it wrong in a way that's worse<br>
&lt;miriam> ack TabAtkins<br>
&lt;emilio> ?<br>
&lt;emilio> TabAtkins: if this is just a matter of UA rule then it is fixable<br>
&lt;florian> q+<br>
&lt;emilio> ... as we discover that they're wrong we can just get them fixed<br>
&lt;emilio> ... as the way it'd be designed you could override any of the mappings<br>
&lt;miriam> ack r12a<br>
&lt;emilio> r12a: what florian and fantasai were worried about is if this is baked into the browser<br>
&lt;TabAtkins> i'm happy to separate the "define the at-rule" part from the "and then put a default version of it into the UA stylesheet"<br>
&lt;emilio> ... proposal so far is to make it an author controlled rule for now<br>
&lt;emilio> ... I think that should be less problematic<br>
&lt;miriam> ack florian<br>
&lt;emilio> florian: what I'm about to say depends on whether this is auto-turned-on or not<br>
&lt;emilio> ... do authors need to opt in?<br>
&lt;emilio> TabAtkins: proposal is to define some new at-rule to define mapping from "generic family" to concrete style<br>
&lt;emilio> ... then there's the question of "should we have a default in the UA sheet"<br>
&lt;emilio> florian: the later makes me very nervous<br>
&lt;fantasai> +1 florian<br>
&lt;emilio> ... e.g., english is a roman-alphabet language and someone could consider using roman numerals<br>
&lt;fantasai> s/later/latter/<br>
&lt;emilio> ... sure we could fix it<br>
&lt;jensimmons> q?<br>
&lt;emilio> ... and in english we'd notice fairly easily<br>
&lt;emilio> ... but maybe not for smaller languages<br>
&lt;emilio> TabAtkins: I don't think we'd auto-apply it to ol<br>
&lt;fantasai> s/and someone could consider using roman numerals/, so suppose someone thought that it would be appropriate to use roman numerals, and then shipped it out across the Web. That would be very disruptive/<br>
&lt;emilio> ... but if auto-applying the mapping is controversial let's discuss that separately<br>
&lt;emilio> fantasai: I think we need a more specific proposal<br>
&lt;emilio> TabAtkins: assuming there's no objections I think we should pursue this idea<br>
&lt;emilio> [more discussion about auto-applying vs not]<br>
&lt;fantasai> s/sure we could fix it/sure, we could fix it--and for English it would happen quickly--but for a less common language, it could take a long time to bubble up/<br>
&lt;emilio> jensimmons: you wouldn't be declaring the whole counter styles, but you'd define the mapping to language and you'd have to use it in your list-style<br>
&lt;emilio> florian: as long as we don't auto apply &lt;ol> in numeric types<br>
&lt;emilio> ... I'm fine<br>
&lt;TabAtkins> `@generic-counter-style digits { en-US: decimal; ...}`rather than `ol:lang(en-US) { list-style-type: decimal; } ...`<br>
&lt;emilio> jensimmons: instead authors would need to opt-in into this generic-digits<br>
&lt;miriam> ack fantasai<br>
&lt;emilio> fantasai: two thoughts. How much of this could be done using our existing mechanism using lang selectors with a `counter-style` property<br>
&lt;emilio> ... other question is, even with a new opt-in keyword for this and deployed that what I'd expect to see is that a lot of people that are authoring pages would use it and then get wrongly translated things in other languages<br>
&lt;emilio> TabAtkins: let's push that topic out<br>
&lt;emilio> ... not discussing applying anything automatically<br>
&lt;emilio> fantasai: not talking about that, just about any thing in the UA sheet<br>
&lt;emilio> ... if only for authors, do we need a new mechanism, or can we use :lang()<br>
&lt;emilio> TabAtkins: let's stop discussing the second point. Can authors do this today? yes<br>
&lt;emilio> ... see example above<br>
&lt;emilio> ... this would be essentially just sugar over that<br>
&lt;emilio> ... possibly a bit more efficient for browsers (less selectors?)<br>
&lt;emilio> ... but yeah it'd essentially be just sugar over selectors<br>
&lt;emilio> r12a: I don't think that's quite right<br>
&lt;emilio> ... in the labeled-digits example you can just use in the stylesheet to use digits<br>
&lt;emilio> ... so I think it's a little extra<br>
&lt;emilio> TabAtkins: no you can always just apply the language selectors you want yourself<br>
&lt;emilio> ... nothing fundamentally new or magical about it<br>
&lt;r12a> generic-counter-style: "digits" {<br>
&lt;r12a>     'ar':'arabic-indic',<br>
&lt;r12a>     'bn':'bengali',<br>
&lt;r12a>     'my':'myanmar',<br>
&lt;r12a>     'az-arab':'arabic-indic',<br>
&lt;r12a>     'suz':'my-own-sunuwar-style',<br>
&lt;r12a>     .... }<br>
&lt;emilio> miriam: seems like back to the issue for the full proposal<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7959#issuecomment-1601234949 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 21 June 2023 16:59:14 UTC