-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from ripe-tech/acaldas/translation
added locale api
- Loading branch information
Showing
6 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
const locale = require("./locale"); | ||
const oauth = require("./oauth"); | ||
const order = require("./order"); | ||
const size = require("./size"); | ||
|
||
Object.assign(module.exports, locale); | ||
Object.assign(module.exports, oauth); | ||
Object.assign(module.exports, order); | ||
Object.assign(module.exports, size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
if (typeof require !== "undefined") { | ||
// eslint-disable-next-line no-redeclare | ||
var base = require("../base"); | ||
// eslint-disable-next-line no-redeclare | ||
var ripe = base.ripe; | ||
} | ||
|
||
ripe.Ripe.prototype.locale = function(value, locale, options, callback) { | ||
return this.localeMultiple(value, locale, options, callback); | ||
}; | ||
|
||
ripe.Ripe.prototype.localeMultiple = function(values, locale, options, callback) { | ||
values = typeof values === "string" ? [values] : values; | ||
callback = typeof options === "function" ? options : callback; | ||
options = typeof options === "function" ? {} : options; | ||
var url = this.url + "locale"; | ||
options = Object.assign(options, { | ||
url: url, | ||
method: "GET", | ||
params: { | ||
values: values, | ||
locale: locale | ||
} | ||
}); | ||
options = this._build(options); | ||
return this._cacheURL(options.url, options, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters