1

I'm trying to change a couple error messaging strings on the frontend in 2 places. First in the regular customer login.

enter image description here

enter image description here

And also in the tooltip in the checkout login. I've tried editing translations, overriding validation js files and nothing seems to be working.

2
  • Is the issue specific to Error messages (JS string) only ? Are translations for normal text strings working?
    – Devtype
    Commented Nov 15, 2016 at 17:23
  • @Devtype. Yes. This is for JS error messaging only.
    – Paul
    Commented Nov 15, 2016 at 18:05

3 Answers 3

1

Please check that validation errors text in lib/web/mage/validation.js is like $.mage.__('validation error msg') and not like 'validation error msg'.

If it is not using $.mage.__() it will not be translated and you need to override this file in your theme inside app/design/frontend/Vendor/theme-name/web/mage.

Here you need to use $.mage.__('') and put error msgs like $.mage.__('Please enter a valid email address (Ex: [email protected]).') Also you can change validation messages here.

0

Update.

It's my solution, now debugging. Please try.

I already put translation csv.

copy

vendor/magento/magento2-base/lib/web/mage/validation/validation.js vendor/magento/magento2-base/lib/web/mage/validation.js

into your Theme.

ex.

app/design/frontend/VENDOR/YOUR_THEME/web/js/locale/validation

Modify require-config.js

var config = {
       map: {
           '*': {
               "validation": 'js/locale/validation/validation',
               'mage/validation': 'js/locale/validation'
           }
       }
};

Then, clean up your cache etc. and,

bin/magento setup:static-content:deploy
-1

Firstly, you can ensure that normal translations (non JS) are working. For UI components and JS error messages etc I experience that you've to deploy static files for translations to take affect.

bin/magento setup:static-content:deploy

Clear the cache and it should work.

1
  • I've tried changing the translation in my theme's csv file, and deployed the static content and it still doesn't work. I can verify that text in that csv file is being translated properly. It seems that changing js validation messaging isn't as simple editing the translation file.
    – Paul
    Commented Nov 16, 2016 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.