[EDIT]
This is outdated. The translation is not done anymore as described below
[/EDIT]
In Magento 1 the translatable texts needed in javascript were added in the jstranslate.xml file in the etc folder of a module and they were automatically added to the translator js object.
How can I add translatable texts to be used in javascript in Magento 2?
I found how to use text translations in Magento 2 but I don't know how to add new ones.
Here is an example on how to use them:
alert($.mage.__('Text to translate here'));