Magento – Magento2: JS Translations not working

knockoutjsmagento2

On my Magento version 2.1.4, I have added language file nl_NL.csv under app/design/frontend/Vendor/Themename/i18n folder. It's working fine for strings added in php code like this

But the translations not showing for string added in KO JS like this

Can anyone tell me what could be the issue? OR how can I create js translations?
I understand there is a file js-translation.json generated in pub/static/frontend/Hyp/deboomhut/nl_NL directory which is responsible for js translations. But don't know how it's generated and from where it pulls the tralsations. So any help will be appreciated.

Best Answer

Remove /var/view_processed directory.

Delete file pub/static/frontend/Hyp/deboomhut/nl_NL/js-translations.json file.

Deploy static content. After that visit website in browser with Ctrl+F5.

If still now work then open file js-translations.json in browser with Ctrl+F5.

And then visit website.

Related Topic