3.0.1 • Published 4 years ago
translocalizer v3.0.1
Translocalizer
Translocalizer is a tool for localizing your application in seconds.
Available Languages
Translocalizer uses Yandex Translate under the hood, so check this page for the list of available languages.
Installation
Yarn:
$ yarn add -D translocalizer
NPM:
$ npm install -D translocalizer
Usage
To use Translocalizer
, you will need a Yandex Translate API key, which you can obtain here. Create a new key for every project since using a certain key too many times in succession can lead to rate limiting.
Using the CLI
// translocalizer.json
{
"basePath": "i18n",
"srcFile": "en.json",
"filenameTemplate": "*.json",
"languages": ["fr", "it"],
"apiKey": "trnsl.1.1..."
}
$ translocalizer [options]
To see all available options, run this command:
$ translocalizer --help
Using the API
import { Translocalizer } from "translocalizer";
const config = {
basePath: "i18n",
srcFile: "en.json",
filenameTemplate: "*.json",
languages: ["fr", "it"],
apiKey: "trnsl.1.1..."
};
Translocalizer.localize(config);