Page 1 of 1

Translate card errors

Posted: 28 Dec 2017, 09:00
by Kevin
Hi,

How is it possible to translate errors when validating the card info in the checkout. Errors like:

Card has expired
Your card's security code is invalid.
...

Thanks !

K.

Re: Translate card errors

Posted: 29 Dec 2017, 12:43
by aimeos
If the error messages are returned by Stripe, you should pass the ISO language code via the Stripe API so Stripe returns error messages for that language. In case you want to do some local checks and return errors before sending the data to Stripe, you can use the translate view helper to translate error messages to other languages via the config:

Code: Select all

<?= $this->translate( 'client', 'Card number invalid' ); ?>
https://aimeos.org/docs/Laravel/Overwrite_translations