Skip to content

js-translation.json generation incomplete #9073

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

Closed
AlexandreKhayrullin opened this issue Mar 31, 2017 · 19 comments
Closed

js-translation.json generation incomplete #9073

AlexandreKhayrullin opened this issue Mar 31, 2017 · 19 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 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

Comments

@AlexandreKhayrullin
Copy link

Preconditions

The Magento used is the "develop" branch.
PHP: PHP 7.0.10-1+deb.sury.org~xenial+1

Steps to reproduce

  1. Install a locale pack on Magento (in this case, the locale is es_ES)
  2. Set Magento in production mode.
  3. Display a UiComponent on frontend using the installed locale

Expected result

  1. The texts on the UiComponent are correctly translated

Actual result

  1. The texts remain in English (or, rather, use the translation keys)

It seems that the generation of js-translation.json is inconsistent between developer and production modes.
In production mode, the JSON either contains very few values (see js-translation.production.json in the attached ZIP file) or just an empty array. In developer mode, the JSON contains a lot more strings (see js-translation.developer.json in the attached ZIP file) , enough to make the UiComponents translatable.

js-translation.zip

@Khaleel
Copy link

Khaleel commented Apr 2, 2017

I have the same issue with ar-json - not always Arabic files are generated in the JSON.

We expect that updating the CSV file should also update the Knockout JS files and Magento translation but it does not - this include local storage translation API

@cjohansson
Copy link

Have the same issue with a clean Magento 2 install with a valid language pack. It's missing a lot of translations.

@marcosdsdba
Copy link

I've tested and problem persists also in Version 2.1.6

I found the problem mostly in Checkout

@PascalBrouwers
Copy link
Contributor

PascalBrouwers commented May 18, 2017

Same problem here. I used the workaround explained here: #2056 (comment)

@Tristan-N
Copy link

Also having trouble with this situation. Especially with the "Place order now" button. Can't get it translated. Not using CSV, not using complete language packs and inline translation doesn't work either.

@PascalBrouwers
Copy link
Contributor

I just had it in developer mode too. This happens so often now that I remove the js-translation.json and run setup:static-content:deploy for my local language every time a translation doesn't work.

@cjohansson
Copy link

We have created a work-around with a custom script which converts all .csv files to js-translation.json files and then manually rewrite requests to js-translation.json in our web-server to our custom files and it works everytime.

@Tristan-N
Copy link

@PascalBrouwers Thank you for the information, but that didn't work for me either. It's both in dev mode and in prod mode. I am wondering; does this issue occur in the checkout too? For me it's only in the checkout. Do you use a custom OneStepCheckout by for example Hungersoft or Magestore?

@PascalBrouwers
Copy link
Contributor

We do have Magestore OSC, but it doesn't matter where the translation is when the entire js-translation.json file is empty :)

@Tristan-N
Copy link

Ah, i found out that the translations in our Magestore OSC broke because of $t('string') weren't the same as the data-bind in the span. I solved it by matching the data-binds (see screenshot). Maybe it might help you too.
solution

@shanavas786
Copy link
Contributor

Same issue here, $t translations work fine in developer mode, but fails in production mode

@Khaleel
Copy link

Khaleel commented Sep 5, 2017

@cjohansson please can you share this solution of making a custom json file as I was considering doing the same. I would really appreciate it - is it a module or snippet that you can opensource?

@shanavas786
Copy link
Contributor

shanavas786 commented Sep 5, 2017

rm pub/static/<area>/<vendor>/<theme>/<lang>/js-translation.json
setup:static-content:deploy <lang> --theme=<vendor>/<theme>

generated proper js-translation.json for <lang>, and translations work fine.

@magento-engcom-team magento-engcom-team added G1 Passed 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 Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 Nov 17, 2017
@magento-engcom-team
Copy link
Contributor

@AlexandreKhayrullin, thank you for your report.
We've created internal ticket(s) MAGETWO-84070 to track progress on the issue.

@henk-hypershop
Copy link

Any update on this issue?

@LiamKarlMitchell
Copy link

A problem in 2.3 it seems.

@tuyennn
Copy link
Member

tuyennn commented Apr 3, 2019

I'm working on a Persian language project and have same issue experience.
Magento 2.2.7 #10860

@engcom-Bravo engcom-Bravo self-assigned this Dec 27, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 27, 2019

Hi @engcom-Bravo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@engcom-Bravo
Copy link
Contributor

Hello @AlexandreKhayrullin
Unfortunately, I cannot reproduce this issue by steps you described on 2.4-develop
Please feel free to comment, reopen or create a new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest 2.4-develop branch. Thank you for collaboration.

@engcom-Bravo engcom-Bravo removed their assignment Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 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

No branches or pull requests