Socket
Book a DemoInstallSign in
Socket

wti

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wti

A WebTranslateIt command-line tool in Node.js

1.1.4
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

wti

A WebTranslateIt command-line tool in Node.js.

npm build status Commitizen friendly code style: prettier semantic-release

screenshot

Usage

Installation

$ yarn global add wti

Configuration

Basically, wti is to be run on a project root directory, and looks for a wti-config.json file containing your project's informations.

The command wti init lets you create this file.

$ wti init
What is your project's api key?: <your private key>
Initializing...... [SUCCESS] Project is initialized

You can find the API token in your project settings.

Usage

Execute wti help to see the usage:

USAGE
  $ wti [COMMAND]

COMMANDS
  add        create and push a new master language file
  addLocale  add a new locale to the project
  help       display help for wti
  init       configure the project to sync with
  pull       pull target language file(s)
  push       push master language file
  rm         delete a master language file from a project

See `wti help <command>` for more information on a specific command.

Sample commands

CommandAction
wti add <path/to/master/file.json>Upload a new master language file
wti rm <path/to/master/file.json>Delete a master language file
wti pushUpdate a master language file
wti pullDownload target language files
wti addLocale frAdd a new locale to the project
wti rmLocale frRemove a locale from the project
wti statusView project statistics

i18next example

1. Prerequisite

  • Create a project on WebTranslateIt with a source language (such as english)
  • Bootstrap a React app

2. Install and configure i18next

$ yarn add i18next react-i18next
$ yarn add -D i18next-parser

// Extract locales
$ i18next --config i18next-parser.config.js

3. Install and configure WTI client

$ yarn add -D wti
$ wti init
$ wti add locale fr
$ ... add other languages
$ wti add locales/en/translation.json
$ wti push

4. Translate keys on WebTranslateIt, and then pull translations

$ wti pull

5. Add or remove translation keys

$ i18next --config i18next-parser.config.js
$ wti push

Keywords

wti

FAQs

Package last updated on 30 Jun 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.