TranslateJSONObject - A Node.js module to translate a JSON object from a detectable language to any other language currently via google or yandex translate API
Kind: global function
Returns: Object
- Module API
- TranslateJSONObject() ⇒
Object
- ~init(options) ⇒
boolean
- ~translate(srcObj, language) ⇒
Promise
- ~init(options) ⇒
init - Initialize the setting of your module instance, it takes a setting object
Kind: inner method of TranslateJSONObject
Returns: boolean
- indicate if the module is configured properly
Param | Type |
---|---|
options | Object |
translate - Translate an object to any given language, it returns a promise with the translated object
Kind: inner method of TranslateJSONObject
Returns: Promise
- It returns a promise with the translated object
Param | Type | Description |
---|---|---|
srcObj | Object |
The object to be translated |
language | String |
The language you wish to translate too, accept the code e.g 'es', 'fr', 'ar' ... |