Module: mixins/language

The language mixin is responsible for retrieving and setting the languages of a project.
Source:

Methods

(inner) language(project_slug, language_code)

Retrieve the details of a project's target language.
Parameters:
Name Type Description
project_slug string The projects slug
language_code string The target language code
Source:
Example
txApi.languageRead('testproject','en').then(function(data) {});

(inner) languageCreate(project_slug, form)

Add a new target language to the project.
Parameters:
Name Type Description
project_slug string The projects slug
form object An object containing the target language code and the coordinators array
Source:
Example
txApi.languageCreate('testproject', {
   language_code: 'en',
   coordinators: [
     'alexapi1'
   ]
})

(inner) languageDelete(project_slug, language_code)

Remove a target language from the project
Parameters:
Name Type Description
project_slug string The projects slug
language_code string The target language code
Source:
Example
txApi.languageDelete('testproject','en')

(inner) languages(project_slug)

Retrieve the target languages of the project.
Parameters:
Name Type Description
project_slug string The projects slug
Source:
Example
txApi.languages('testproject').then(function(data) {})

(inner) languageUpdate(project_slug, language_code, form)

Update a project's target language.
Parameters:
Name Type Description
project_slug string The projects slug
language_code string The target language code
form object An object containing the target language code and the coordinators array
Source:
Example
txApi.languageUpdate('testproject', 'en', {
  list: 'mylist@listserver.com',
  coordinators: [
   'alexapi1'
  ]
})