A similar question was already asked here: Magento 2 javascript text translations, but Magento updated this translation technique in the beta version.
How can I add or update translations used by Javascript?
I figured out that Magento creates a file called 'js-translation.json' in the static folder. If I edit this file directly, I see that my translations are updated. But where is this file created, and how can I add translations so that Magento will automatically add this to js-translation.json when it's generated?
Update
The correct answer to this question is still not given, altough Mage2.PRO pointed me to the right direction, it's not the full answer. My js-translation.json is still empty when generated.
For example, I like to translate the Add To Cart button. This button has three states, Add To Cart, Adding... and Added... How can I translate these words? Another example, the 'You have no items in your shopping cart.' text in the minicart. I think all these phrases should be translated from js-translation.json, but where to add them so these file is filled with these translations?
$.mage.__('Add To Cart')
it will be automatically picked up by thesetup:static-content:deploy
command. The only catch is that you have to have in the locale files a different translation for the text. The texts that have as translation the same text are not added to the json file in order to not increase the size without a reason.