1.0.10 • Published 3 years ago

node-json-ibm-watson-translator v1.0.10

Weekly downloads
20
License
ISC
Repository
github
Last release
3 years ago

Installation

npm install node-json-ibm-watson-translator --save-dev or global npm install node-json-ibm-watson-translator -g

Usage

node-json-ibm-watson-translator

Example Console

Supports:

  • {{interpolation}}
  • <span>sample</span>
  • <0>sample</0>
  • <a href="http://google.com">sample</a>
  • $t(g:Nested key)

Vars

AttributeDefaultDescription
LOCALE_FOLDER./localesName of the locales folder, inside should be language folders e.g. "en"
OUTPUT_LANGUAGESfrComma separated list of languages to be translated into
CONFIG_PATH./njiwt.jsonPath for the config file (see below)
FORCED_GLOSSARY_FILESgComma separated list of names of the files that will not be translated, just copied
COPY_FILESindex.ts,index.jsComma separated list of non-JSON file names to be copied

Config file structure (.json)

{
  "url": "https://...", // IBM service url here
  "apikey": "a1b2c3...", // IBM api key
  "inputLanguage": "en" // language code used for input it will use this folder too
}

(Extra): Generate supported languages .json file

LANGUAGES_PATH=./supported-languages.json node-json-ibm-watson-translator-languages

TODO

  • Windows OS support
  • Add the option not to translate certain words/phrases
  • Recursive multi level JSON objects and arrays. (At the moment only strings, 1st level arrays and 1st level objects)
  • Instead of overwriting whole files, ability to add new keys only to existing translations
  • Make sure attributes of html elements are not translated in all languages
1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago