
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
auto-translator
Advanced tools
Trasnlates angular code around from translation json files back to JS so you can work on your translations easily
Translating multiple languages in Angular through JSON seamlessly
We use this at TipRanks internally, anyone who wants to read the code have a go - but this is for internal use and we do not intend to provide support any external users. Pull requests will be entertained if accompanied by tests.
###What this does
This package is meant for processing multiple languages in Angular. Translation files are stored in JSON and the script uses esprima/escodegen or cheerio to swap the file content with the relevant translation.
Translating is hard and working with foreign JSON files isn't fun, especially when you need to debug how something looks in a foreign language and you end up going back and forth between JSON translations and HTML files.
This solves that problem.
For example, you can take:
var foo = translated("greeting","Hello!");
Run this with fileToJson and lang=en and get
{"greeting":{"en": "Hello!"}
Then have a translator write the same text in German, getting
{"greeting":{"en": "Hello!","de":"Hallo!"}
Now, if you want to build or debug the german version, you can run the code with the jsonToFile option and get:
var foo = translated("greeting","Hallo!");
When you're done working on it, you can push it back to the json and load another version. This also has the advantage that translation is a build step and there is no performance overhead in having a translated site.
The HTML syntax is <tr-translated="greeting">Hello</tr-translated> and does the same thing.
###Usage
Generating or updating the JSON from an HTML or JS file:
node translator.js --source=YOURJSOrHTMLSourceFile --json=YOURJSON.json --lang=en --dir=fileToJson
Updating the HTML or JS file with JSON
node translator.js --source=YOURJSOrHTMLSourceFile --json=YOURJSON.json --lang=en --dir=fileToJson
###Running tests
Run the tests using mocha tests.
Users may use it under the MIT license.
FAQs
Trasnlates angular code around from translation json files back to JS so you can work on your translations easily
We found that auto-translator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.