Not translated "Please enter a valid email address (Ex: [email protected])."
In checkout with guest customer when enter invalid email address in "Email" field that time display this error and that is not translated.
if you have a look at Magento/Ui/view/base/web/js/lib/validation/rules.js
$.mage.__('Please enter a valid email address (Ex: [email protected]).')
that means that error message is translated, but probably you don't have the right translation in your translation file, so it's not a Magento 2 issue, more of who's maintaining your language pack You can manually add that into your language file
@pareshe were you able to resolve this issue by translating this string in your language pack? If so please close the issue or provide more details
Please check this screen-shot: http://awesomescreenshot.com/0f1600sw6a
I am facing the same issue in Magneto 2.1.0.
I have the following line in sl_SI.csv:
"Please enter a valid email address (Ex: [email protected]).","Prosimo vnesite veljaven elektronski naslov (Primer: [email protected]).",module,Magento_Ui
Magento is still not translating the string, despite I removed pub/static, var/cache, var/generation, var/page_cache, var/view_preprocessed folders and ran bin/magento setup:static-content:deploy sl_SI command and refreshed the cache.
Same issue here in Magento 2.1
Same issue in M2.1 :-(
Hope this fix is included in >= 2.1.1
Same here in M2.1 Translating Magento should have become easier with M2 but it has become a nightmare to get some simple stuff translated. To get my theme translated I'm now working with 2 translation files. One general Magento i18n under app/i18n/locale/locale.csv and one in the theme. As some strings (from .js files) are not translatable by my theme csv file like "Search entire store here" I ended up making the general magento translation file. Also I might expect that a theme translation is always ruling and thus overruling the general magento translation but I found out that my theme translations were gone after I placed a general magento locale translation in app/i18n. So I stripped down that file to only contain what I cannot translate in my theme translation file like the .js strings. And even with all these trials and errors, still johndoe is here to stay. Why...?
Hi :)
The solution for most of this not translated errors in validation is the following library "mage/validation". Most of the returned messages do not call the mage translation method.
You can override the file with your own file by using a module with a requirejs-config:
/*jshint browser:true jquery:true*/
/*global alert*/
var config = {
"map": {
"*": {
'mage/validation': 'YourVendor_CoreBugFix/js/model/validation',
}
}
};
You can translate every validation hint after surronding it with a $.mage.__('') method call:
$.mage.__('Please enter a valid email address (Ex: [email protected]).')
@shockwavemk Yeah, I saw this solution a couple of times but in my opinion this should be translatable by a translation or theme translation. So without an extra module. I will use this solution for the time being until it is solved in a coming M2 release.
Some additional hint: some errors are still not translateable by default even if you surround all values in validation.js. For example: passwords have to be same.
To solve this issue just add an override of the method "equalTo" (jquery.validate.js) into the validation.js
/**
* Collection of validation rules including rules from additional-methods.js
* @type {Object}
*/
var rules = {
"equalTo": [
function (value, element, param) {
// bind to the blur event of the target in order to revalidate whenever the target field is updated
// TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
var target = $(param);
if (this.settings.onfocusout) {
target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function () {
$(element).valid();
});
}
return value === target.val();
},
$.mage.__('Please enter the same value again.')
],
"max-words": ...
still present in 2.1.1...
@pareshe @jernejh @Tjitse-E @SchumacherFM @onepack @heldchen sorry for slow reply. We created internal issue MAGETWO-59123.
Thank you. That took you 4 month ...
appreciated, @SerhiyShkolyarenko
Can confirm that translation for strings in lib/web/mage/validation.js are missing. It looks like they have been hard-encoded and is not interfaced with any translation layer.
Refs:
- Internal Issue: MAGETWO-59123
- Magento Enterprise Support Case: #03191452
- Duplicated by: #6141
Remains unsolved in 2.1.2.
@PieterCappelle: Yes, no change with that patch. We're trying hard on our end to technically raise and escalate the issue. However it looks like that Magento (the vendor) is (currently) blocked by the load in it's queue. I wish the vendor have taken more care about translation (everything not in en_US) from the very beginning.
They should take some time to clear their queue before the next release.
They should take some time to clear their queue before the next release.
As it turns out, we are. Expect a lot of fixes up to and especially including 2.2.
@benmarks: Just by chance, any list at hand?