-
Notifications
You must be signed in to change notification settings - Fork 135
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
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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direction should also be at the Node level, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sent whatwg/html#6676 ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL. I thought 6676 was an issue, but it's a PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aphillips, would that work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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