Transifex

  • Documentation
  • API
  • Languages

Languages

The Languages endpoint supports CRUD operation on the languages of a project (identified by a project_slug).

Setting a language

URL: /project/<project_slug>/languages/

GET

Return a JSON encoded list with the fields language_codecoordinatorstranslators and reviewers that are responsible and work on the languages that belong to the project.

Note

Only the project owner or the project maintainers have access to this method.

Example:

$ curl -i -L --user api:<token> -X GET https://www.transifex.com/api/2/project/transifex/languages/

HTTP/1.1 200 OK

[
 {
  'language_code': 'el',
  'coordinators': [
   'kbairak',
   'glezos'
  ],
  'translators': [
   'mpessas',
   'jkal',
  ],
  reviewers: [
   'sawidis',
   'ilias'
  ]
 },
 {
  'language_code': 'hi',
  'coordinators': [
   'rajeshr',
   'rtnpro'
  ],
  'translators': [
   'sayan'
  ],
  reviewers: [
   'chandankumar'
  ]
 }
]

POST

You can use this POST request in order to:

1) Add a new language to the project - a language group will also be created.

2) Update the list of collaborators of an existing language group.
Please note that in this case, the existing collaborators will be overwritten by the ones that will be provided in the API call. Make sure you provide the full list of the people. For example, if you have 3 people and you want to add 1 more, your request should have all 4 people in it.

The fields language_code and coordinators must be specified. The available optional fields are:

  • translators: a list of usernames.
  • reviewers: a list of usernames.
  • list: an email address of a mailing list for the translators of the language.


Note

Only the project owner or the project maintainers have access to this method.

If the keyword skip_invalid_username is given as a GET parameter, then if at least one of the given usernames is invalid, then the API call doesn't fail. Instead a JSON response is returned containing a list of invalid usernames.

Example:

$ curl -X POST -i -H "Content-Type: application/json" -L
--data '{"language_code": "es", "coordinators": ["christos", "random"]}'
--user api:<token> https://www.transifex.com/api/2/project/transifex/languages/?skip_invalid_username

HTTP/1.1 200 OK

{
  'invalid_usernames': [
    'random'
  ]
}

Managing a language instance

URL: /project/<project_slug>/language/<language_code>/

GET

Return a JSON encoded string with the fields language_codecoordinatorstranslators and reviewers for the specified language. If the keyword details is given as a GET parameter, then extra fields are returned:

  • translated_segments
  • untranslated_segments
  • reviewed_segments
  • total_segments
  • translated_words
  • list

Note

Only the project owner, the maintainers and the people working on the translations for that language may access this method.

$ curl -i -L --user api:<token> -X GET https://www.transifex.com/api/2/project/transifex/language/el/?details

HTTP/1.1 200 OK

[
 {
  'coordinators': [
   'kbairak',
   'glezos'
 ],
  'translators': [
   'mpessas',
   'jkal',
 ],
  reviewers: [
   'sawidis',
   'ilias'
  ],
  'translated_segments': 1518,
  'untranslated_segments': 96,
  'reviewed_segments': 1325,
  'total_segments': 1614,
  'translated_words': 10022,
  'list': '',
 }

POST

Update an existing language of a project. The fields coordinatorstranslatorsreviewers and list are allowed to be updated using this method. One must ensure that the coordinators field is not empty, because there must be a coordinator managing the translations for a language.

Note

Only the project owner, the project maintainers and the coordinators for the language can perform this operation.

DELETE

Delete an existing language of the project.

Note

Only the project owner, the project maintainers and the coordinators of the language can perform this operation.

Managing people

Coordinators

URL: /project/<project_slug>/language/<language_code>/coordinators/

GET

Return a JSON list of the username of coordinators for the language of the project. Only the project owner, the maintainers and the people working on the translations for that language may access this method.

PUT

Update the list of coordinators for a language of a project. It accepts a JSON encoded list of usernames. This list cannot be empty.

Example:

$ curl -i -L --user api:<token> -X GET https://www.transifex.com/api/2/project/transifex/language/el/coordinators/

HTTP/1.1 200 OK

[
 'glezos',
 'kbairak'
]

If the keyword skip_invalid_username is given as a GET parameter, then if at least one of the given usernames is invalid, then the API call doesn't fail. Instead a JSON response is returned containing a list of invalid usernames.

Example:

{
  'invalid_usernames': [
    'random_username1',
    'random_username2'
  ]
}

Reviewers

URL: /project/<project_slug>/language/<language_code>/reviewers/

GET

Return a JSON list of the username of reviewers for the language of the project. Only the project owner and the maintainers may access this method.

PUT

Update the list of reviewers for the language of the project. It accepts a JSON encoded list of usernames.

Example:

$ curl -i -L --user api:<token> -X GET https://www.transifex.com/api/2/project/transifex/language/el/reviewers/

HTTP/1.1 200 OK

[
 'sawidis',
 'ilias'
]

Keyword skip_invalid_username can be specified as a GET parameter like in the case of coordinators.

Translators

URL: /project/<project_slug>/language/<language_code>/translators/

GET

Return a JSON list of the usernames of the translators for the language of the project. Only users who can submit translations for the language have access to this method.

PUT

Update the list of translators for a language of the project. It accepts a JSON encoded list of usernames.

Example:

$ curl -i -L --user api:<token> -X GET https://www.transifex.com/api/2/project/transifex/language/el/translators/

HTTP/1.1 200 OK

[
 'mpessas',
 'jkal'
]

Keyword skip_invalid_username can be specified as a GET parameter like in the case of coordinators.