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

Credit Card error messages are shown in english even if the site locale is in another language and translations exists #34

Open
ofinsterbusch opened this issue Nov 14, 2024 · 6 comments

Comments

@ofinsterbusch
Copy link

Hi,

I saw another problem with translations, title is self descriptive, translations for other languages are not taken even if they exist in the flashes messages.

This is a DE locale for example:
Screenshot 2024-11-14 at 10 10 59

Thank you for checking!

@logeecom
Copy link
Contributor

Hello @ofinsterbusch,

Please note that our team is working on this issue.

As soon as we have some valid information to share, we will let you know.

Thank you,

Kind regards.

@logeecom
Copy link
Contributor

Hello @ofinsterbusch,

Please note that the credit card components are created dynamically using mollie js library. This library is responsible for field validation and handling error messages as well.

This means that our plugin can not add any translation for these messages.

If you have any questions or concerns, please let us know.

Kind regards.

@ofinsterbusch
Copy link
Author

Hello @logeecom ,

Thanks for the answer.

But this means that these messages can not be translated? or that they don't exists in the mollie js library?

As far I as check in app.js:360

` const cardHolder = mollie.createComponent('cardHolder');

    cardHolder.mount('#card-holder');

    const cardHolderError = document.getElementById('card-holder-error');
    cardHolder.addEventListener('change', (event) => {
        if (event.error && event.touched) {
            cardHolderError.textContent = event.error;
        } else {
            cardHolderError.textContent = '';
        }
    });`

That event.error should be the one that can be translated, maybe not in the sylius plugin side but on the mollie response, maybe adding the locale in the call or something similar.

It's a bit weird that we don't get those messages translated in the most common languages at least.

Don't you agree?

@DamjanLogeecom
Copy link

Hello @ofinsterbusch,

The following message
image-20241202-130510
is read from the event object, using event.error.
This event.error is attached inside the external Mollie js library. The event object does not have any language or locale property on itself. The only way to add these translations would be to change our plugin to fetch the locale inside js file and then to call our plugin’s controller to fetch the appropriate translation for the given language.
image-20241202-130541
We will forward this information to the Mollie team and inform you if this change will be implemented, as it requires a deeper analysis on our end.

Thank you,

Kind regards.

@DamjanLogeecom
Copy link

Hello @ofinsterbusch,

Thank you for your patience,

Please note that we require more time to provide you with information on whether this issue will be worked on.

As soon as we have an update, we will let you know.

Kind regards.

@ofinsterbusch
Copy link
Author

Hello @DamjanLogeecom,

Thanks for the update and please let me know if you need more information.

From our side we are checking if we can do something in the meantime to add our on errors in that form as we wouldn't like to show english messages for other languages.

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants