For example "Email address" in checkout billing address form is not added to js-translation.json
although it exists in the language package.
Manually adding it to the generated file makes it appear in checkout.
Other sentences not added are for example "You can create an account after checkout.", "Go to Checkout", "View and edit cart", "Order Summary", "Ship To:" and "Item in Cart".
For some reason "Items in Cart" is picked up.
@rasmuswikman Thank you for reporting, we have created ticket MAGETWO-51780 to investigate and fix.
After some further investigation it seems that the strings were not picked up by the translation tool when I created the dictionary. Manually adding the missing strings to my language package resolved some of them.
Adding "item", "items" and "See Details" to the CSV did not help, they are still missing from the JSON.
Probably unrelated to these is "Phone Number" in the checkout forms. The only way to translate it is to edit it directly in the database table "eav_attribute".
Hi @rasmuswikman I just checked all of these phrases are translatable. I believe you might not be using develop branch with the latest and greatest fixes :)
@rasmuswikman @hshar7 @mazhalai I have the same problem. I have to add manually the translation to the file js-translation.json. If I add the translations to the .csv translation file, it doesn't work.
How this can be done automatically?
I'm using Magento 2.1.
Thanks.
Agreed. Add translate file for zh_Hans_CN, all sites was translated but translation-js.json is empty.
Magento 2.1
Same here EE 2.1
same
2.1.2
Facing the same issue. Please help
I'm with the same issue.
using Luma when I click on "Add To Cart" in es_ES the text is updated by "Adding" them "Added" and Finally "Add To Cart" in English.
I see the js-translation and is empty.
As a workaround it seems that deleting js-translation.json from pub/static/frontend/Magento/[theme]/[lang_code]/ allows "setup:static-content:deploy [lang_code]" to correctly generate the file.
Hope it helps you until Magento patches this issue
@hshar7 - It seems you've closed this issue in error. I and other users are still experiencing this issue. I've added a number of translatable strings to my themes i18n/en_us.csv
file and none of the .html translatable strings are included in js-translation.js. Let me give you some more details so you will not write this off as user error.
Here are the full contents of my en_US.csv file in my theme.
"Sign In", "Register"
"Sign Up for Our Newsletter:", "Newsletter"
"Enter your email address", "Enter your email"
"Search entire store here...", "Search"
"Review by", "By"
"Posted on", ","
"We found other products you might like!","You May Also Like"
"My Cart", "My Bag"
"You have no items in your shopping cart.", "You have no items in your bag."
"View and edit cart","View and edit bag"
"Item in Cart", "Item in Bag"
"Items in Cart", "Items in Bag"
The last 5 lines are all strings I am wanting to translate from .html files. After deleting the js-translation.json file from my theme's pub directory and running bin/magento setup:static-content:deploy
successfully, here is what the contents of the generated js-translation.json file look like.
[]
As you can see, none of those 5 strings are in the json file. This issue was experienced on the latest version of Magento 2 at this time (2.1.5). If you could please re-open this issue and begin the investigation anew, I and the rest of us experiencing this issue would appreciate it.
Any information on this ? I see "Done in branch [develop]" but there is no commit referenced.
The issue is still here on Magento 2.2
Duplicate of #4067
Most helpful comment
@hshar7 - It seems you've closed this issue in error. I and other users are still experiencing this issue. I've added a number of translatable strings to my themes
i18n/en_us.csv
file and none of the .html translatable strings are included in js-translation.js. Let me give you some more details so you will not write this off as user error.Here are the full contents of my en_US.csv file in my theme.
The last 5 lines are all strings I am wanting to translate from .html files. After deleting the js-translation.json file from my theme's pub directory and running
bin/magento setup:static-content:deploy
successfully, here is what the contents of the generated js-translation.json file look like.As you can see, none of those 5 strings are in the json file. This issue was experienced on the latest version of Magento 2 at this time (2.1.5). If you could please re-open this issue and begin the investigation anew, I and the rest of us experiencing this issue would appreciate it.