Re: [w3c/payment-request] Localization and string metadata for descriptions (#948)

From the commit in #971:

> The language and direction of the {{PaymentItem/label}} may often be determined from information inherited from the document

May be determined _how_? For the direction, I'd suggest taking it from [the principal writing mode](https://www.w3.org/TR/css-writing-modes-3/#principal-flow) of the document. The language could probably also be taken from the language on the root element, likely with the usual HTML rules for taking the combination of the lang attribute, information from [meta](https://html.spec.whatwg.org/multipage/semantics.html#meta) elements, and also the protocol (e.g. from HTTP headers) into account.

If additional mechanisms are later introduced to provide more flexibility, they could always override this default, but it seems preferable to make the default unambiguous.

Accidental incorrect detection of the language or direction (and related interoperability problems) can potentially make text somewhat confusing, or even downright unreadable. Using a Chinese font for Japanese content (or vice versa) may present the user with some unfamiliar characters, and going ltr where rtl is expected (or vice versa) can scramble the content.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/948#issuecomment-1208006301
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/payment-request/issues/948/1208006301@github.com>

Received on Monday, 8 August 2022 11:30:18 UTC