Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/translate/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ Translate.prototype.getLanguages = function(target, callback) {
* is written in.
* @param {string} options.to - The ISO 639-1 language code to translate the
* input to.
* @param {string} options.format - This optional parameter allows you to indicate the text
* to be translated is either plain-text or HTML.
* A value of 'html' indicates HTML and a value of 'text' indicates plain-text.
* Defaults to 'html' if not specified.
* @param {function} callback - The callback function.
* @param {?error} callback.err - An error returned while making this request.
* @param {object|object[]} callback.translations - If a single string input was
Expand All @@ -295,7 +299,8 @@ Translate.prototype.getLanguages = function(target, callback) {
* //-
* var options = {
* from: 'en',
* to: 'es'
* to: 'es',
* format: 'text'
* };
*
* translate.translate('Hello', options, function(err, translation) {
Expand Down Expand Up @@ -337,6 +342,10 @@ Translate.prototype.translate = function(input, options, callback) {
if (options.to) {
query.target = options.to;
}

if (options.format) {
query.format = options.format;
}
}

if (!query.target) {
Expand Down