QuickNav
Methods
- addDocument(projectId, authToken, name, content, sourceLocale, additionalData) → {Promise.<object>}
- addProject(authToken, communityId, workflowId, projectName) → {Promise.<string>}
- addTranslation(authToken, projectId, id, locale) → {Promise.<object>}
- getCommunity(authToken) → {Promise.<object>}
- getDocument(authToken, id) → {Promise.<string>}
- getDocumentImportProcess(authToken, id) → {Promise.<string>}
- getDocumentTranslationStatus(authToken, id, locale) → {Promise.<object>}
- getDocumentTranslationStatuses(authToken, id) → {Promise.<object>}
- getProjectStatus(authToken, id) → {Promise.<string>}
- getTranslation(authToken, id, locale) → {Promise.<string>}
ConnectorApi
new ConnectorApi()
Connector's interface to the Language Service Provider.
Handles all the required GET/POST/DELETE requests.
Handles all the required GET/POST/DELETE requests.
- Source:
Methods
addDocument(projectId, authToken, name, content, sourceLocale, additionalData) → {Promise.<object>}
Import a document into the Language Service Provider.
Parameters:
Name | Type | Description |
---|---|---|
projectId |
string | Identifier of the project that will include the document. |
authToken |
string | Authorization header token to include in the request. |
name |
string | Name of the document. |
content |
string | JSON content of the document. |
sourceLocale |
string | The source locale for the document. |
additionalData |
string | Additional data to apply on each document. |
- Source:
Returns:
The response from the Language Service Provider.
- Type
- Promise.<object>
addProject(authToken, communityId, workflowId, projectName) → {Promise.<string>}
Create a new project in the Language Service Provider.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
communityId |
string | Community identifier that should contain the project. |
workflowId |
string | Identifier of the Language Service Provider workflow to use to translate any documents. |
projectName |
string | Name of project to create. |
- Source:
Returns:
The Language Service Provider string id for the created project.
- Type
- Promise.<string>
addTranslation(authToken, projectId, id, locale) → {Promise.<object>}
Request the document be translated into the given locale.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
projectId |
string | Identifier of the project that will include the document. |
id |
string | Language Service Provider identifier for the document. |
locale |
string | Name of the locale to check. |
- Source:
Returns:
The Language Service Provider POST "/:id/translation" response.
- Type
- Promise.<object>
getCommunity(authToken) → {Promise.<object>}
Get the details about the community for this user.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
- Source:
Returns:
The Language Service Provider GET "/community" response.
- Type
- Promise.<object>
getDocument(authToken, id) → {Promise.<string>}
Get the document identified by the Language service provider Id
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
id |
string | Language Service Provider identifier for the document. |
- Source:
Returns:
The content of the document.
- Type
- Promise.<string>
getDocumentImportProcess(authToken, id) → {Promise.<string>}
Get the document identified by the Language service provider Id
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
id |
string | Language Service Provider identifier for the document. |
- Source:
Returns:
The content of the document.
- Type
- Promise.<string>
getDocumentTranslationStatus(authToken, id, locale) → {Promise.<object>}
Get the status of the specified locale of the document in the Language Service Provider.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
id |
string | Language Service Provider identifier for the document. |
locale |
string | Name of the locale to check. |
- Source:
Returns:
The Language Service Provider GET "/:id/translation" response specific for the requested locale.
- Type
- Promise.<object>
getDocumentTranslationStatuses(authToken, id) → {Promise.<object>}
Get the statuses of all the locales of the document in the Language Service Provider.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
id |
string | Language Service Provider identifier for the document. |
- Source:
Returns:
The Language Service Provider GET "/:id/translation" response.
- Type
- Promise.<object>
getProjectStatus(authToken, id) → {Promise.<string>}
Get the percent complete of the project.
This represents the percentage complete of the translations for all the documents in the project.
This represents the percentage complete of the translations for all the documents in the project.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
id |
string | Language Service Provider identifier for the document. |
- Source:
Returns:
The Language Service Provider GET "/:id/status" response.
- Type
- Promise.<string>
getTranslation(authToken, id, locale) → {Promise.<string>}
Get the translation of the document for the given locale.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string | Authorization header token to include in the request. |
id |
string | Language Service Provider identifier for the document. |
locale |
string | Name of the locale to check. |
- Source:
Returns:
The Language Service Provider GET "/:id/translation/:locale" response.
- Type
- Promise.<string>