1

I use magento 2.0 and I have a problem.

The JS messages of fields control do not translated (like Please enter a valid email address (Ex: johndoe@domain.com). or Please enter 6 or more characters. Leading or trailing spaces will be ignored.)

This is a sample:

enter image description here

3

1) magento 2.0.5 (test - true)

lib/web/mage/validation.js

line 246 :

replace : 'Please enter a valid email address (Ex: johndoe@domain.com).'
$.mage.__('Please enter a valid email address (Ex: johndoe@domain.com).')
2) Del. static : pub/static/ (only dir) and var/view_preprocessed/ 
|improve this answer|||||
  • Have you verified this issue with upstream? E.g. is this reported? If so can you please provide a link or a ticket number? That would be tremendously great. – hakre Oct 4 '16 at 11:29
0

To solve this Magento bug, I copy the file lib/web/mage/validation.js to my theme and translated it there.

So, the translated file is in: app/design/frontend/<vendor>/<theme>/web/mage/validation.js

|improve this answer|||||
  • app/design/frontend/vendor/theme/web/mage/validation.js – Kako Sabolo Jul 27 '17 at 0:04
0

Instead of direct changes in js. Make csv as per locale Ex: app/design/frontend///i18n/de_DE.csv(locale name).

Ex:

"You can create an account after checkout.","Sie können nach dem Auschecken ein Konto erstellen."

"Provided Zip/Postal Code seems to be invalid.","Die angegebene Postleitzahl scheint ungültig zu sein."

" Example: "," Beispiel: "

"If you believe it is the right one you can ignore this notice.","Wenn Sie glauben, dass es das richtige ist, können Sie diesen Hinweis ignorieren."

Run the following commands:

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy de_DE -f

php bin/magento cache:clean

Now refresh the page with Ctrl + F5.

Now you can see js messages are translated

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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