[w3c/payment-request] Note about localization of payment sheet (#952)

3.3 show() method 
https://www.w3.org/TR/2020/CR-payment-request-20201203/#show-method


(Found in NOTE under item # 18):
> Note: Localization of the payment sheet
>
> The API does not provide a way for developers to specify the language in which the payment sheet is presented to end users. As such, user agents will generally present the payment sheet using the user agent's default language. The working group is contemplating adding the ability for developers to specify the language of the payment sheet, and of specific PaymentItems, in a future version of this API.

This issue is a specific example of #946 

The user agent's default language and the language of the rendering site or host page might not match. Usually items shown as part of the payment-initiating customer experience should match the language and locale of that experience. Defaulting to the user agent's locale would could thus produce a mixed language experience, which is undesirable.

It seems like a significant oversight not to provide for localizability and language negotiation. The mechanisms for this are well-known and reasonably straightforward. Why isn't this included in this version?

----

In the I18N repo, @marcoscaceres noted:

> The user agent's default language and the language of the rendering site or host page might not match. Usually items shown as part of the payment-initiating customer experience should match the language and locale of that experience. Defaulting to the user agent's locale would could thus produce a mixed language experience, which is undesirable.

When implementing the payment sheet in Firefox, we ran into a bunch of issues/restrictions (particularly on mobile / Play Store). In particular, we couldn't ship a localized version of each payment sheet because it ended up hitting the APK size limits, and there was hesitation on including localized content that might not be used, again because of the additional weight. The compromise was to just use the system default language 😢.

> It seems like a significant oversight not to provide for localizability and language negotiation. The mechanisms for this are well-known and reasonably straightforward. Why isn't this included in this version?

We did have it in the spec that the use agent SHOULD use the language of the web page to localize the payment sheet, but sadly, we couldn't get anyone to implement it, so we removed it:

https://github.com/w3c/payment-request/pull/896/


We could add that back in, but I fear it will remain aspirational. 

Here is what the spec used to say:

> "Present a user interface that will allow the user to interact with the handlers... It is RECOMMENDED that the language of the user interface match the language of the body element."

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

Received on Wednesday, 31 March 2021 16:23:23 UTC