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

Add missing translations in Magento_UI #11440

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

JeroenVanLeusden
Copy link
Member

Description

Add missing translations in UI module taken from mage/validation.js file.

Fixed Issues (if relevant)

  1. Untranslatable string "Please enter the same value again." #5956: Untranslatable string "Please enter the same value again."

Manual testing scenarios

  1. Install dutch language pack.
  2. Set locale of frontend to dutch.
  3. Create new user on the storefront, Fill both password fields with a different value.
  4. String should be translated.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@fooman fooman self-assigned this Oct 15, 2017
@fooman fooman added this to the October 2017 milestone Oct 15, 2017
@fooman fooman added Release Line: 2.2 2.2.x bug report Area: Frontend Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 15, 2017
@fooman
Copy link
Contributor

fooman commented Oct 16, 2017

@JeroenVanLeusden thanks for this pull request. I am currently unable to confirm that this patch does indeed fix the issue.

Couple of questions:

  1. Are there any other steps needed to verify the translations works?
    I have used honl/magento2-nl-nl (which didn't seem to include this term so I added a dummy translation) and run bin/magento clear:cache and have also wiped the pub/static content in developer mode, but am still seeing:

screen shot 2017-10-17 at 11 24 09

  1. Is there a reason that this added to the UI module? It seems that at least the string
    "Please enter the same value again." is already present here.

@fooman
Copy link
Contributor

fooman commented Oct 17, 2017

I have now tested in production mode which successfully translated
"Please enter the same value again."
for me. However this was without the changes of this PR applied.

@JeroenVanLeusden
Copy link
Member Author

JeroenVanLeusden commented Oct 17, 2017

@fooman Even in production the mode the string isn't translated. Could it be your dummy translations you've added earlier in the process?

I did the following steps to reproduce the issue:

  • composer require honl/magento2-nl-nl
  • Create file src/lib/web/i18n/nl_NL.csv and add "Please enter the same value again.","Vul dezelfde waarde nog een keer in."
  • php bin/magento setup:static-content:deploy nl_NL -j 1 -f
  • In src/pub/static/frontend/Magento/luma/nl_NL/js-translation.json the string isn’t translated.
  • In src/app/code/Magento/Ui/i18n/nl_NL.csv add "Please enter the same value again.","Vul dezelfde waarde nog een keer in, Magento_UI"
  • php bin/magento setup:static-content:deploy nl_NL -j 1 -f
  • In src/pub/static/frontend/Magento/luma/nl_NL/js-translation.json the string is translated with the Magento_UI prefix.

I added them to Magento_UI since most translations from mage/validation.js are located there. The strings located here are not used at all.

@fooman
Copy link
Contributor

fooman commented Oct 25, 2017

@JeroenVanLeusden can you try the following on your end:

  • composer require honl/magento2-nl-nl
  • add
    "Please enter the same value again.","Vul dezelfde waarde nog een keer in.",module,Magento_Ui to vendor/honl/magento2-nl-nl/crowdin.csv
  • then run bin/magento setup:static-content:deploy nl_NL en_US -j 1 -f

After the above I get the below

screen shot 2017-10-25 at 20 42 14

I do believe there is still some oddity somewhere (possibly in the quick deploy strategy) as just running bin/magento setup:static-content:deploy nl_NL -j 1 -f did not work.

@JeroenVanLeusden
Copy link
Member Author

@fooman Following your steps resulted in a translated string. Running bin/magento setup:static-content:deploy nl_NL -j 1 -f wil also translate the string in my case. So far so good.

I decided to add them to Magento_UI because php bin/magento i18n:collect-phrases -o "strings.csv" -m collects the string as "Please enter the same value again.","Please enter the same value again.",lib,lib/web/mage/validation.js and when adding that to vendor/honl/magento2-nl-nl/crowdin.csv it results in a non translated string.

@fooman
Copy link
Contributor

fooman commented Oct 25, 2017

Thanks @JeroenVanLeusden for confirming. So this narrows it down to there being an issue with either the output of collect-phrases not being correct or lib,lib/web/mage/validation.js not working correctly when applied.

For now your suggested approach seems a reasonable workaround considering that this seems to have already been done in the past. I'll proceed with merging this one - however can you please take a look at line 203.

"Please enter no more than {0} characters.","Please enter no more than {0} characters."
"Please enter at least {0} characters.","Please enter at least {0} characters."
"Please enter a value between {0} and {1} characters long.","Please enter a value between {0} and {1} characters long."
Please enter a value between {0} and {1}.
Copy link
Contributor

@fooman fooman Oct 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Please enter a value between {0} and {1}." Misses second part and quotes

@JeroenVanLeusden
Copy link
Member Author

@fooman Thanks for the update. I also corrected line 203.

@magento-team magento-team merged commit 0e301a3 into magento:2.2-develop Oct 26, 2017
magento-team pushed a commit that referenced this pull request Oct 26, 2017
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-82724 Allow coupon code with special charater to be applied to order in checkout #11710
 - MAGETWO-82675 Add a health check to the NGINX configuration sample #11690
 - MAGETWO-82562 Coupon codes not showing in invoice #11635
 - MAGETWO-82535 Fixed ability to set field config from layout xml #11302 [backport 2.2] #11643
 - MAGETWO-81146 Fixing #10275 keyboard submit of adminhtml suggest form. #11250
 - MAGETWO-82761 [Backport 2.2-develop] Dashboard Fix Y Axis for range #11751
 - MAGETWO-82748 Fix Notice: freePackageValue is undefined #11720
 - MAGETWO-82747 [TASK] Updated user.ini according to Magento DevDocs #11734
 - MAGETWO-82537 MAGETWO-81311: Check the length of the array before attempting to sli… #11637
 - MAGETWO-81970 Add missing translations in Magento_UI #11440
 - MAGETWO-81904 FIX #11022 in 2.2-develop: Filter Groups of search criteria parameter have not been included for further processing #11421
 - MAGETWO-82179 Fix Filter Customer Report Review 2.2-develop [Backport] #11522
@JeroenVanLeusden JeroenVanLeusden deleted the patch-5 branch December 4, 2017 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend bug report Progress: needs update Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants