woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
234 stars 206 forks source link

Using a screen reader, the Stripe credit card form is read in English, regardless of what language it is displayed in #925

Open fhaps opened 5 years ago

fhaps commented 5 years ago

Affected ticket(s)

2201402-zen

What I expected

If I have my website set up in a language other than English, and I'm using a screen reader, that it will read the credit card form fields in the language those fields are configured (and displayed) in.

What happened instead

Even if the site is configured in French, and the credit card fields actually have French labels, the screen reader reads them as if they were in English.

The labels are in French, as can be seen in the following screenshot:

Image Link: https://cld.wthms.co/vyFrsa

But the screen reader actually says this, in English, not French:

Credit or debit card number
Credit or debit card expiration date
MM / AA

Credit or debit card CVC/CVV
CVC

The customer reporting this added this for context, which might help understand the issue:

Screen readers rely on the lang attribute of a page to determine which language to speak. I noticed that the credit card fields are within a frame – that may call a page where the lang attribute is forced to "en", instead of adapting to the native site language.


RiaanKnoetze commented 5 years ago

User included the following screencast of what they're experiencing: https://drive.google.com/open?id=19J6CteSzWFAV0_tBUjL0lzM_Yx96JGSK

dechov commented 5 years ago

We could/should be passing locale to Stripe.js, which localizes the elements to some extent, but unfortunately it affects neither the aria-label attributes on the fields nor the lang attribute on the iframed page. Not seeing a way to put those in the desired language – something to ask Stripe.