2

I am using some translation packages from Packagist (magento2translations/*) and I have some translation files in my theme at app/design/frontend/Mytheme/mytheme/i18n. On the PHP side, they all work flawlessly. But in client-side code, the translations aren't working at all.

I tracked the problem down to the generated js-translation.json files. They are all empty (i.e. the only contain an empty array "[]").

I found some people having the same problem here and on GitHub and some (very different) solutions, but none of them have worked for me. Every time I run bin/magento setup:static-content:deploy <locale>, the deployed JSON file is still empty.

Edit: the js-translation.json is only populated in languages that I have language packages installed for, but not for languages I translated in app/design/frontend/Omv/omv/i18n.

Also, the translations from app/design/frontend/Omv/omv/i18n aren't present in js-translation.json - not even for languages I have a language pack for. Is this intended or a bug?

Edit 2: The js-translation.json files are not empty in my local development environment. I have no idea why.

  • Check the permission again. – Khoa TruongDinh Nov 10 '16 at 9:28
  • @KhoaTruongDinh You mean before running the static content deploy command? I'm pretty sure they are set correctly, but just to be sure: can you point me to the specific steps in the Magento 2 docs that I should follow? (I am running Apache on Ubuntu - so I have a user magento that's in the www-data group.) – Rudolph Gottesheim Nov 10 '16 at 9:42
  • 1
    @RudolphGottesheim, Have you got it solved? I have same issue here! – Zinat Feb 21 '17 at 9:44
  • 1
    @Zinat Nope, sorry. – Rudolph Gottesheim Feb 21 '17 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.