{"repo":"AnandChowdhary/auto-i18n","free":true,"listed":false,"github":"https://github.com/AnandChowdhary/auto-i18n","clone":"git clone https://github.com/AnandChowdhary/auto-i18n.git","description":"🌐 Automatically translate your JSON I18N files","language":"TypeScript","stars":32,"topics":["i18n","typescript","translation","l18n","automation","nodejs","google-translate"],"license":"MIT","category":"workflow-automation","readme_excerpt":"🌐 Auto I18N Auto I18N is a package which automagically translate your JSON files, objects, or strings using Google Translate. It's automating your internationalization. ⭐ Usage Add the dependency from NPM: Import the modules you require from the package: And then configure your Project ID and API key as environment variables (see Configuration). Translating words To translate a single phrase: For every function, can also use promises: Translating objects To translate an entire object: Translating a single-translation file A single translation file is a JSON file which contains keys for language codes and terms under each key. You can write one for English like this, for example: File en.json : To translate it, use the translateFileSingle function: This is what translated looks like: You can also write the file directly by supplying the third parameter as true : Translation a regular JSON file If you have a JSON file which is not a single-translation-file, you can also translate it: Generated translated files If you have a JSON file (e.g., en.json ), you can also generate corresponding language files: 💡 Notes Caching Auto I18N uses local caching powered by Fraud to decrease API usage and therefore billing. A caching directory, .cache/auto-i18n is used, which should be added to your .gitignore . You can overwrite this directory as a parameter in each function. Configuration Auto I18N uses the Google Cloud Translation API, for which an API key and Project ID are required. Thes","default_branch":null,"files":null,"tree":[],"storefront":"/r/AnandChowdhary","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/AnandChowdhary/auto-i18n/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}