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

Error message in product review form not being translated #10474

Closed
Kivike opened this issue Aug 9, 2017 · 5 comments
Closed

Error message in product review form not being translated #10474

Kivike opened this issue Aug 9, 2017 · 5 comments
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@Kivike
Copy link

Kivike commented Aug 9, 2017

Preconditions

  1. Magento 2.1.7 CE

Steps to reproduce

  1. Submit review without setting rating

Expected result

  1. Error 'Please select one of each of the ratings above.' should be translated

Actual result

  1. Error is always in english
@emmathepossum
Copy link

The problem is that the error message is hardcoded into the template file:
module-review/view/frontend/templates/form.phtml on line 40.

Until this is fixed, you can do the following:

  1. Override the template file (Magento_Review/templates/form.phtml in your theme) and change Line 40 to something like this: data-validate="{'required-rating':true}"

  2. Override the validation.js (web/js/validation.js in your theme) and add this to the rules object (Line 167):

'required-rating': [
    function(value) {
        return value !== undefined;
    },
    $.mage.__('Please select one of each of the ratings above.')
]
  1. Add the overridden validation.js to your requirejs-config.js
var config = {
    map: {
        '*': {
            'mage/validation': 'js/validation',
            'mage/validation/validation': 'js/validation'
        }
    },
    "deps": [
        'mage/validation'
    ]
};
  1. Translate the phrase in your csv file

  2. Clear caches

@magento-engcom-team magento-engcom-team added G1 Passed bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 18, 2017
@Echron
Copy link
Member

Echron commented Sep 26, 2017

I will see if i can fix this one

@okorshenko
Copy link
Contributor

@Kivike thank you for your report. The issue is already fixed in 2.2-develop branch (PR: #11069 by @Echron) and will be available in the Magento 2.2.2 release

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 4, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-80224

@magento-team magento-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Oct 4, 2017
@okorshenko
Copy link
Contributor

Hi @Kivike. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1323 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@okorshenko okorshenko added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

7 participants