Magento2 localisation Javascript
Not sure if you figured it out already, but I thought I'd answer anyway..
I guess the other answers are heading in the right direction.
Assuming you already have the translations installed, if not please:
bin/magento i18n:pack -m replace -d source_nl_NL.csv . nl_NL
So, first of all, please clear the cache(as others suggested as well):
rm -rf var/cache var/generation var/page_cache var/view_preprocessed
Secondly, please clear your pub/static folder:
rm -rf pub/static/*/
Then we regenerate the static-content: (I missed the langcode in the other answers..)
bin/magento setup:static-content:deploy nl_NL
- Make sure you add the langcode
Now check if there were any js-translation.json created:
find pub/static/ -name "js-translation.json"
Most likely you'll get a list of js-translation.json
files. Please check these files and delete them if they're empty or contain something like []
.