-
Notifications
You must be signed in to change notification settings - Fork 9
/
url.js
32 lines (30 loc) · 1.36 KB
/
url.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module.exports = function ( projectName ) {
const BASE_URL = "https://www.transifex.com/api/2/";
const BASEP_URL = BASE_URL + "project/";
const projectUrl = BASEP_URL + projectName + "/";
const prSlug = BASEP_URL + "<project_slug>/resource/<resource_slug>/";
const plSlug = BASEP_URL + "<project_slug>/language/<language_code>/";
const translationUrlBase = prSlug + "translation/<language_code>/";
var API = {
projectInstanceAPI: BASEP_URL + "<project_slug>/?details",
projectResources: BASEP_URL + "<project_slug>/resources/",
projectResource: prSlug + "?details",
projectResourceContent: prSlug + "content/",
projectResourceFile: prSlug + "content/?file",
languageSetURL: BASEP_URL + "<project_slug>/languages/",
languageInstanceURL: plSlug + "?details",
contributorForURL: plSlug + "<type>/",
translationUrlBase: prSlug + "translation/<language_code>/",
translationMethodURL: translationUrlBase + "?file",
translationStringsPutURL: translationUrlBase + "strings/",
translationStringsURL: translationUrlBase + "strings/?details<string_key>",
statsMethodURL: prSlug + "stats/<language_code>/",
languageURL: BASE_URL + "language/<language_code>/",
languagesURL: BASE_URL + "languages/",
txProjects: BASE_URL + "projects/",
projectDetailsAPIUrl: projectUrl + "?details"
};
return {
API: API
};
};