A simple PHP script to speed up the translation setup for Angular apps using ngx-translate module.
In order to run the script, you need to have PHP installed on your machine.
Most Mac OS versions ship with PHP, so it's very likely you won't have to do anything. If that's not the case, for more info on how to install it, click here.
- Define your constants on
input.txt
file; - Choose source and target language;
- Using English (
en
) as source (default) and Spanish (en
) as target, open your Terminal and runphp translate.php en es
.
Now you can copy and paste the translations on your respective .json
files.
Note: you need a valid key in order to use the Google Translation API. More info here.