Skip to content
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

Note about localization of payment sheet #952

Closed
aphillips opened this issue Mar 31, 2021 · 2 comments
Closed

Note about localization of payment sheet #952

aphillips opened this issue Mar 31, 2021 · 2 comments
Labels
Has Pull Request i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on.

Comments

@aphillips
Copy link

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:

#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."

@aphillips aphillips added the i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. label Mar 31, 2021
@marcoscaceres
Copy link
Member

Was possibly addressed by #944 ... will leave for i18n folks to close.

@aphillips
Copy link
Author

I am satisfied by #944.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Has Pull Request i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on.
Projects
None yet
Development

No branches or pull requests

2 participants