translocalizer
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

Translocalizer

Travis Version Issues License Dependencies

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);

Readme

Keywords

none

Package Sidebar

Install

npm i translocalizer

Weekly Downloads

2

Version

3.0.1

License

MIT

Unpacked Size

183 kB

Total Files

8

Last publish

Collaborators

  • arnohovhannisyan