It might be an issue with hardcoded lines but first try to find the strings in the corresponding phtml files.
You can use template hints under System > Configuration > Developer > Debug
(set scope to the website) to see what phtml file the line is in. Then open up that file, probably under app/design/frontend/[package]/[template]/template/path/to/file.phtml
and look for the line Add to Cart for example.
Check if it is inside something that looks like
<?php echo $this->('Add to Cart')?>
If so: go to the locale/nl_NL/translate.csv
file under app/design/frontend/[package]/[template]/
or create it and add the line
"Add to Cart","Voeg toe aan winkelwagen"
"Go to Top","Ga naar boven"
If it's not wrapped in the above code you can do so yourself. This will tell Magento to translate it
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 []
.
Best Answer
OK. I found a solution but it seams ugly to me.
In the layout handle of the page I need I add this:
then create the template
translate.phtml
in[Namespace]/[Module]/view/[frontend|adminhtml]/templates
with this content:I really hope there is an other way of doing this.