Derive direction from document element too#956
Conversation
|
Hi @marcoscaceres, Thanks for starting this. Some thoughts:
What about a Note that says: "This API relies on inherited localization information. The working group is considering support for fine-grained localization of the user interface and of individual PaymentItems in a future version of this API." |
ianbjacobs
left a comment
There was a problem hiding this comment.
(See my comments above)
That's the truth tho :) Will update based on your suggestions. |
|
@aphillips, would you mind having a look at this proposal to address the lack of fine-grain localization in V1 of the API? Thank you! |
aphillips
left a comment
There was a problem hiding this comment.
Generally looks good. Small tweaks proposed.
index.html
Outdated
| SHOULD be presented using the language, base direction, and | ||
| locale-based formatting that matches the |document|'s [=document | ||
| element|document element's=] [=Node/language=] and | ||
| {{Document/dir}} attribute, if any, or an appropriate fallback |
There was a problem hiding this comment.
The direction should also be at the Node level, no?
There was a problem hiding this comment.
It should, but there is no such thing on Node unfortunately:
https://dom.spec.whatwg.org/#node
The only "dir"s in the platform are:
https://respec.org/xref/?term=dir
There was a problem hiding this comment.
Oh, wait... we might be able to use https://html.spec.whatwg.org/multipage/dom.html#the-directionality ... but I'll need to get it "exported" so we can use it in our spec.
There was a problem hiding this comment.
@marcoscaceres Thanks. I squinted at {{HTMLElement/dir}} and it wasn't clear to me if it included inherited direction. [^html-global/dir^] is the definition of the dir attribute and includes inheritance, but doesn't seem quite to match our needs here. Exporting directionality is a better solution--not just here but generally! I may take whatwg/html#6676 to expedite ;-).
There was a problem hiding this comment.
LOL. I thought 6676 was an issue, but it's a PR...
There was a problem hiding this comment.
@aphillips, take a look at @annevk's comments at whatwg/html#6676 ... I think they make a lot of sense.
My feeling is that we punt on the direction for now, and solve this with "localizable" in a future version of the spec.
There was a problem hiding this comment.
LGTM.
@marcoscaceres I'm pondering a reply to @annevk: I think he is right, although I18N does want to promote using the document's context when it is available and is appropriate.
Related to, but does not close #327, #946, #948, #951
The following tasks have been completed:
Implementation commitment:
Optional, impact on Payment Handler spec?
Preview | Diff