Open kacpr opened 2 weeks ago
Hi @kacpr , thanks for reaching out and providing all the details. This is the intended behavior currently, we parse the locale based on Java's Locale forLanguageTag method, which means that pl-PL
is the expected format and pl_PL
will not parse properly.
Can your backend change the shopperLocale
value sent in the /sessions
request to pl-PL
? That is also the expected format by our API and should solve the issue.
Hi @jreij ! Thank you for the quick response! Yes, we've already changed it and it's WORKING, however I wanted to point out this problem, because:
These beahviors gave us false leads (mixed translations -> checking for overrides; Android vs iOS - searching for bugs in Android) and cost us some time :)
I strongly believe it's possible to fix these discrepancies (e.g. informing about invalid format; fixing mixed translations), which will probably spare some time to other teams and make the dropin more user-friendly :)
@kacpr good points! It makes sense that we support locales formatted with underscores if the backend and iOS do. We already raised this point internally and we're discussing the best way to solve it. But for now good to hear that using pl-PL
works for you.
Thanks again for raising this, I will change this issue into an enhancement and keep it open to provide updates later when it's resolved.
Awesome! Thanks @jreij
Description
Strings in dropin are translated partially. When
shopperLocale
is set to:Backend uses
sessions
integration flow. Backend setshopperLocale
to "pl_PL". Android app receivesCheckoutSession
withSessionSetupResponse.shopperLocale
set to"pl_PL"
.Since strings in dropin are partially translated, I believe there are multiple call sites and methods that try to obtain locale and this flow isn't bulletproof.
Expected behavior (possible solutions):
shopperLocale
properly or inform about invalid formatSteps to Reproduce
CheckoutSession
fromSessionSetupResponse.createSession()
CheckoutSession
from stepi
with overwrittenSessionSetupResponse.shopperLocale
("pl_PL")Blik z kodem
andKarta bankowa
):"pl-PL":
Code Snippets
Maybe this will be helpful: during debugging I found that those methods weren't using / returning correct locale:
Integration Information
Additional Context
Related issues: https://github.com/Adyen/adyen-react-native/issues/15 https://github.com/Adyen/adyen-android/issues/1558 https://github.com/Adyen/adyen-android/issues/680
Keywords: localization, translations, language, resources