i18n-translate

Automatically translates require.js i18n JSON files via Google Translate API

Usage no npm install needed!

<script type="module">
  import i18nTranslate from 'https://cdn.skypack.dev/i18n-translate';
</script>

README

i18n-translate Build Status npm

Automatically translates require.js i18n javascript files into different languages via Google Translate API.

Installation

npm install -g i18n-translate

Usage

You need a Google Translate API Key.

i18n-translate apiKey startDir sourceLang targetLang1,targetLang2,.. (file1,file2,..)

e.g.

i18n-translate iuOHAEbo9H788d34h93h4diouehIUHI test/data/ de en,fr

This would translate all the *.js files in test/data (relative to current folder in the shell) to translate from German to English and French, based on the Google Translate API language codes.

The file filter for specific file names is optional. You can specify files in the target folder that you exclusively want to be translated.