Weblate's REST API

バージョン 2.6 で追加: The REST API is available since Weblate 2.6.

The API is accessible on the /api/ URL and it is based on Django REST framework. You can use it directly or by Weblate クライアント.

Authentication and generic parameters

The public project API is available without authentication, though unauthenticated requests are heavily throttled (by default to 100 requests per day), so it is recommended to use authentication. The authentication uses a token, which you can get in your profile. Use it in the Authorization header:

ANY /

Generic request behaviour for the API, the headers, status codes and parameters here apply to all endpoints as well.

Query Parameters
  • format -- Response format (overrides Accept). Possible values depends on REST framework setup, by default json and api are supported. The latter provides web browser interface for API.

Request Headers
Response Headers
Response JSON Object
  • detail (string) -- verbose description of failure (for HTTP status codes other than 200 OK)

  • count (int) -- total item count for object lists

  • next (string) -- next page URL for object lists

  • previous (string) -- previous page URL for object lists

  • results (array) -- results for object lists

  • url (string) -- URL to access this resource using API

  • web_url (string) -- URL to access this resource using web browser

Status Codes

Authentication examples

Example request:

GET /api/ HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Authorization: Token YOUR-TOKEN

Example response:

HTTP/1.0 200 OK
Date: Fri, 25 Mar 2016 09:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, HEAD, OPTIONS

{
    "projects":"http://example.com/api/projects/",
    "components":"http://example.com/api/components/",
    "translations":"http://example.com/api/translations/",
    "languages":"http://example.com/api/languages/"
}

CURL example:

curl \
    -H "Authorization: Token TOKEN" \
    https://example.com/api/

Passing Parameters Examples

For the POST method the parameters can be specified either as form submission (application/x-www-form-urlencoded) or as JSON (application/json).

Form request example:

POST /api/projects/hello/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Token TOKEN

operation=pull

JSON request example:

POST /api/projects/hello/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{"operation":"pull"}

CURL example:

curl \
    -d operation=pull \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/components/hello/weblate/repository/

CURL JSON example:

curl \
    --data-binary '{"operation":"pull"}' \
    -H "Content-Type: application/json" \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/components/hello/weblate/repository/

API 接続制限

API リクエストは接続制限されています。デフォルト設定では、匿名ユーザーの場合は 100 リクエスト / 日、認証済みユーザーの場合は 5000 リクエスト / 時間に制限されています。

接続制限は settings.py で調整できます。詳細な設定方法は、Throttling in Django REST framework documentation を参照してください。

ヘッダーで報告される接続制限の状態:

X-RateLimit-Limit

実行するリクエストの接続制限回数

X-RateLimit-Remaining

Remaining limit of requests

X-RateLimit-Reset

接続可能秒数がリセットされるまでの秒数

バージョン 4.1 で変更: 接続制限状態のヘッダーの追加。

API Entry Point

GET /api/

The API root entry point.

Example request:

GET /api/ HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Authorization: Token YOUR-TOKEN

Example response:

HTTP/1.0 200 OK
Date: Fri, 25 Mar 2016 09:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, HEAD, OPTIONS

{
    "projects":"http://example.com/api/projects/",
    "components":"http://example.com/api/components/",
    "translations":"http://example.com/api/translations/",
    "languages":"http://example.com/api/languages/"
}

ユーザー

バージョン 4.0 で追加.

GET /api/users/

Returns a list of users if you have permissions to see manage users. If not, then you get to see only your own details.

参考

Users object attributes are documented at GET /api/users/(str:username)/.

POST /api/users/

Creates a new user.

Parameters
  • username (string) -- ユーザー名

  • full_name (string) -- User full name

  • email (string) -- User email

  • is_superuser (boolean) -- Is user superuser? (optional)

  • is_active (boolean) -- Is user active? (optional)

GET /api/users/(str: username)/

Returns information about users.

Parameters
  • username (string) -- User's username

Response JSON Object
  • username (string) -- username of a user

  • full_name (string) -- full name of a user

  • email (string) -- email of a user

  • is_superuser (boolean) -- whether the user is a super user

  • is_active (boolean) -- whether the user is active

  • date_joined (string) -- date the user is created

  • groups (array) -- link to associated groups; see GET /api/groups/(int:id)/

Example JSON data:

{
    "email": "user@example.com",
    "full_name": "Example User",
    "username": "exampleusername",
    "groups": [
        "http://example.com/api/groups/2/",
        "http://example.com/api/groups/3/"
    ],
    "is_superuser": true,
    "is_active": true,
    "date_joined": "2020-03-29T18:42:42.617681Z",
    "url": "http://example.com/api/users/exampleusername/",
    "statistics_url": "http://example.com/api/users/exampleusername/statistics/"
}
PUT /api/users/(str: username)/

Changes the user parameters.

Parameters
  • username (string) -- User's username

Response JSON Object
  • username (string) -- username of a user

  • full_name (string) -- full name of a user

  • email (string) -- email of a user

  • is_superuser (boolean) -- whether the user is a super user

  • is_active (boolean) -- whether the user is active

  • date_joined (string) -- date the user is created

PATCH /api/users/(str: username)/

Changes the user parameters.

Parameters
  • username (string) -- User's username

Response JSON Object
  • username (string) -- username of a user

  • full_name (string) -- full name of a user

  • email (string) -- email of a user

  • is_superuser (boolean) -- whether the user is a super user

  • is_active (boolean) -- whether the user is active

  • date_joined (string) -- date the user is created

DELETE /api/users/(str: username)/

Deletes all user information and marks the user inactive.

Parameters
  • username (string) -- User's username

POST /api/users/(str: username)/groups/

Associate groups with a user.

Parameters
  • username (string) -- User's username

Form Parameters
  • string group_id -- The unique group ID

GET /api/users/(str: username)/statistics/

List statistics of a user.

Parameters
  • username (string) -- User's username

Response JSON Object
  • translated (int) -- ユーザーごとの翻訳数

  • suggested (int) -- ユーザーごとの翻訳数

  • uploaded (int) -- ユーザーごとのアップロード数

  • commented (int) -- ユーザーごとのコメント数

  • languages (int) -- ユーザーが翻訳できる言語の数

GET /api/users/(str: username)/notifications/

List subscriptions of a user.

Parameters
  • username (string) -- User's username

POST /api/users/(str: username)/notifications/

Associate subscriptions with a user.

Parameters
  • username (string) -- User's username

Request JSON Object
  • notification (string) -- Name of notification registered

  • scope (int) -- Scope of notification from the available choices

  • frequency (int) -- Frequency choices for notifications

GET /api/users/(str: username)/notifications/(int: subscription_id)/

Get a subscription associated with a user.

Parameters
  • username (string) -- User's username

  • subscription_id (int) -- 登録済み通知 ID

PUT /api/users/(str: username)/notifications/(int: subscription_id)/

Edit a subscription associated with a user.

Parameters
  • username (string) -- User's username

  • subscription_id (int) -- 登録済み通知 ID

Request JSON Object
  • notification (string) -- Name of notification registered

  • scope (int) -- Scope of notification from the available choices

  • frequency (int) -- Frequency choices for notifications

PATCH /api/users/(str: username)/notifications/(int: subscription_id)/

Edit a subscription associated with a user.

Parameters
  • username (string) -- User's username

  • subscription_id (int) -- 登録済み通知 ID

Request JSON Object
  • notification (string) -- Name of notification registered

  • scope (int) -- Scope of notification from the available choices

  • frequency (int) -- Frequency choices for notifications

DELETE /api/users/(str: username)/notifications/(int: subscription_id)/

Delete a subscription associated with a user.

Parameters
  • username (string) -- User's username

  • subscription_id -- Name of notification registered

  • subscription_id -- int

グループ

バージョン 4.0 で追加.

GET /api/groups/

Returns a list of groups if you have permissions to see manage groups. If not, then you get to see only the groups the user is a part of.

参考

Group object attributes are documented at GET /api/groups/(int:id)/.

POST /api/groups/

Creates a new group.

Parameters
  • name (string) -- グループ名

  • project_selection (int) -- Group of project selection from given options

  • language_selection (int) -- Group of languages selected from given options

GET /api/groups/(int: id)/

Returns information about group.

Parameters
  • id (int) -- Group's ID

Response JSON Object

Example JSON data:

{
    "name": "Guests",
    "project_selection": 3,
    "language_selection": 1,
    "url": "http://example.com/api/groups/1/",
    "roles": [
        "http://example.com/api/roles/1/",
        "http://example.com/api/roles/2/"
    ],
    "languages": [
        "http://example.com/api/languages/en/",
        "http://example.com/api/languages/cs/",
    ],
    "projects": [
        "http://example.com/api/projects/demo1/",
        "http://example.com/api/projects/demo/"
    ],
    "componentlist": "http://example.com/api/component-lists/new/",
    "components": [
        "http://example.com/api/components/demo/weblate/"
    ]
}
PUT /api/groups/(int: id)/

Changes the group parameters.

Parameters
  • id (int) -- Group's ID

Response JSON Object
  • name (string) -- name of a group

  • project_selection (int) -- integer corresponding to group of projects

  • language_selection (int) -- integer corresponding to group of Languages

PATCH /api/groups/(int: id)/

Changes the group parameters.

Parameters
  • id (int) -- Group's ID

Response JSON Object
  • name (string) -- name of a group

  • project_selection (int) -- integer corresponding to group of projects

  • language_selection (int) -- integer corresponding to group of languages

DELETE /api/groups/(int: id)/

Deletes the group.

Parameters
  • id (int) -- Group's ID

POST /api/groups/(int: id)/roles/

Associate roles with a group.

Parameters
  • id (int) -- Group's ID

Form Parameters
  • string role_id -- The unique role ID

POST /api/groups/(int: id)/components/

Associate components with a group.

Parameters
  • id (int) -- Group's ID

Form Parameters
  • string component_id -- The unique component ID

DELETE /api/groups/(int: id)/components/(int: component_id)

Delete component from a group.

Parameters
  • id (int) -- Group's ID

  • component_id (int) -- The unique component ID

POST /api/groups/(int: id)/projects/

Associate projects with a group.

Parameters
  • id (int) -- Group's ID

Form Parameters
  • string project_id -- The unique project ID

DELETE /api/groups/(int: id)/projects/(int: project_id)

Delete project from a group.

Parameters
  • id (int) -- Group's ID

  • project_id (int) -- The unique project ID

POST /api/groups/(int: id)/languages/

Associate languages with a group.

Parameters
  • id (int) -- Group's ID

Form Parameters
  • string language_code -- The unique language code

DELETE /api/groups/(int: id)/languages/(string: language_code)

Delete language from a group.

Parameters
  • id (int) -- Group's ID

  • language_code (string) -- The unique language code

POST /api/groups/(int: id)/componentlists/

コンポーネント リストのセットをグループに関連付ける。

Parameters
  • id (int) -- Group's ID

Form Parameters
  • string component_list_id -- The unique componentlist ID

DELETE /api/groups/(int: id)/componentlists/(int: component_list_id)

Delete componentlist from a group.

Parameters
  • id (int) -- Group's ID

  • component_list_id (int) -- The unique componentlist ID

ロール

GET /api/roles/

Returns a list of all roles associated with user. If user is superuser, then list of all existing roles is returned.

参考

Roles object attributes are documented at GET /api/roles/(int:id)/.

POST /api/roles/

Creates a new role.

Parameters
  • name (string) -- Role name

  • permissions (array) -- List of codenames of permissions

GET /api/roles/(int: id)/

Returns information about a role.

Parameters
  • id (int) -- Role ID

Response JSON Object
  • name (string) -- Role name

  • permissions (array) -- list of codenames of permissions

Example JSON data:

{
    "name": "Access repository",
    "permissions": [
        "vcs.access",
        "vcs.view"
    ],
    "url": "http://example.com/api/roles/1/",
}
PUT /api/roles/(int: id)/

Changes the role parameters.

Parameters
  • id (int) -- Role's ID

Response JSON Object
  • name (string) -- Role name

  • permissions (array) -- list of codenames of permissions

PATCH /api/roles/(int: id)/

Changes the role parameters.

Parameters
  • id (int) -- Role's ID

Response JSON Object
  • name (string) -- Role name

  • permissions (array) -- list of codenames of permissions

DELETE /api/roles/(int: id)/

Deletes the role.

Parameters
  • id (int) -- Role's ID

言語

GET /api/languages/

Returns a list of all languages.

参考

Language object attributes are documented at GET /api/languages/(string:language)/.

POST /api/languages/

Creates a new language.

Parameters
  • code (string) -- 言語名

  • name (string) -- 言語名

  • direction (string) -- Language direction

  • plural (object) -- Language plural formula and number

GET /api/languages/(string: language)/

Returns information about a language.

Parameters
  • language (string) -- 言語コード

Response JSON Object
  • code (string) -- 言語コード

  • direction (string) -- テキストの方向

  • plural (object) -- Object of language plural information

  • aliases (array) -- Array of aliases for language

Example JSON data:

{
    "code": "en",
    "direction": "ltr",
    "name": "English",
    "plural": {
        "id": 75,
        "source": 0,
        "number": 2,
        "formula": "n != 1",
        "type": 1
    },
    "aliases": [
        "english",
        "en_en",
        "base",
        "source",
        "eng"
    ],
    "url": "http://example.com/api/languages/en/",
    "web_url": "http://example.com/languages/en/",
    "statistics_url": "http://example.com/api/languages/en/statistics/"
}
PUT /api/languages/(string: language)/

Changes the language parameters.

Parameters
  • language (string) -- Language's code

Request JSON Object
  • name (string) -- 言語名

  • direction (string) -- Language direction

  • plural (object) -- Language plural details

PATCH /api/languages/(string: language)/

Changes the language parameters.

Parameters
  • language (string) -- Language's code

Request JSON Object
  • name (string) -- 言語名

  • direction (string) -- Language direction

  • plural (object) -- Language plural details

DELETE /api/languages/(string: language)/

Deletes the Language.

Parameters
  • language (string) -- Language's code

GET /api/languages/(string: language)/statistics/

Returns statistics for a language.

Parameters
  • language (string) -- 言語コード

Response JSON Object
  • total (int) -- total number of strings

  • total_words (int) -- total number of words

  • last_change (timestamp) -- last changes in the language

  • recent_changes (int) -- total number of changes

  • translated (int) -- number of translated strings

  • translated_percent (float) -- percentage of translated strings

  • translated_words (int) -- number of translated words

  • translated_words_percent (int) -- percentage of translated words

  • translated_chars (int) -- number of translated characters

  • translated_chars_percent (int) -- percentage of translated characters

  • total_chars (int) -- number of total characters

  • fuzzy (int) -- あいまいな(要編集付き)文字列の数

  • fuzzy_percent (int) -- percentage of fuzzy (marked for edit) strings

  • failing (int) -- number of failing strings

  • failing -- percentage of failing strings

プロジェクト

GET /api/projects/

Returns a list of all projects.

参考

Project object attributes are documented at GET /api/projects/(string:project)/.

POST /api/projects/

バージョン 3.9 で追加.

Creates a new project.

Parameters
  • name (string) -- プロジェクト名

  • slug (string) -- プロジェクトのスラッグ

  • web (string) -- プロジェクトの Web サイト

GET /api/projects/(string: project)/

Returns information about a project.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Response JSON Object

Example JSON data:

{
    "name": "Hello",
    "slug": "hello",
    "url": "http://example.com/api/projects/hello/",
    "web": "https://weblate.org/",
    "web_url": "http://example.com/projects/hello/"
}
PATCH /api/projects/(string: project)/

バージョン 4.3 で追加.

Edit a project by a PATCH request.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

PUT /api/projects/(string: project)/

バージョン 4.3 で追加.

Edit a project by a PUT request.

Parameters
  • project (string) -- プロジェクト URL スラッグ

DELETE /api/projects/(string: project)/

バージョン 3.9 で追加.

Deletes a project.

Parameters
  • project (string) -- プロジェクト URL スラッグ

GET /api/projects/(string: project)/changes/

Returns a list of project changes. This is essentially a project scoped GET /api/changes/ accepting same params.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Response JSON Object
GET /api/projects/(string: project)/repository/

Returns information about VCS repository status. This endpoint contains only an overall summary for all repositories for the project. To get more detailed status use GET /api/components/(string:project)/(string:component)/repository/.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Response JSON Object
  • needs_commit (boolean) -- whether there are any pending changes to commit

  • needs_merge (boolean) -- whether there are any upstream changes to merge

  • needs_push (boolean) -- whether there are any local changes to push

Example JSON data:

{
    "needs_commit": true,
    "needs_merge": false,
    "needs_push": true
}
POST /api/projects/(string: project)/repository/

Performs given operation on the VCS repository.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Request JSON Object
  • operation (string) -- Operation to perform: one of push, pull, commit, reset, cleanup

Response JSON Object
  • result (boolean) -- result of the operation

CURL example:

curl \
    -d operation=pull \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/projects/hello/repository/

JSON request example:

POST /api/projects/hello/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{"operation":"pull"}

JSON response example:

HTTP/1.0 200 OK
Date: Tue, 12 Apr 2016 09:32:50 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, POST, HEAD, OPTIONS

{"result":true}
GET /api/projects/(string: project)/components/

Returns a list of translation components in the given project.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Response JSON Object
POST /api/projects/(string: project)/components/

バージョン 3.9 で追加.

バージョン 4.3 で変更: The zipfile and docfile parameters are now accepted for VCS less components, see ローカル ファイル.

Creates translation components in the given project.

ヒント

Most of the component creation happens in the background. Check the task_url attribute of created component and follow the progress there.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Request JSON Object
  • zipfile (file) -- ZIP file to upload into Weblate for translations initialization

  • docfile (file) -- 翻訳するドキュメント

Response JSON Object

CURL example:

curl \
    --data-binary '{
        "branch": "master",
        "file_format": "po",
        "filemask": "po/*.po",
        "git_export": "",
        "license": "",
        "license_url": "",
        "name": "Weblate",
        "slug": "weblate",
        "repo": "file:///home/nijel/work/weblate-hello",
        "template": "",
        "new_base": "",
        "vcs": "git"
    }' \
    -H "Content-Type: application/json" \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/projects/hello/components/

JSON request example:

POST /api/projects/hello/components/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{
    "branch": "master",
    "file_format": "po",
    "filemask": "po/*.po",
    "git_export": "",
    "license": "",
    "license_url": "",
    "name": "Weblate",
    "slug": "weblate",
    "repo": "file:///home/nijel/work/weblate-hello",
    "template": "",
    "new_base": "",
    "vcs": "git"
}

JSON response example:

HTTP/1.0 200 OK
Date: Tue, 12 Apr 2016 09:32:50 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, POST, HEAD, OPTIONS

{
    "branch": "master",
    "file_format": "po",
    "filemask": "po/*.po",
    "git_export": "",
    "license": "",
    "license_url": "",
    "name": "Weblate",
    "slug": "weblate",
    "project": {
        "name": "Hello",
        "slug": "hello",
        "source_language": {
            "code": "en",
            "direction": "ltr",
            "name": "English",
            "url": "http://example.com/api/languages/en/",
            "web_url": "http://example.com/languages/en/"
        },
        "url": "http://example.com/api/projects/hello/",
        "web": "https://weblate.org/",
        "web_url": "http://example.com/projects/hello/"
    },
    "repo": "file:///home/nijel/work/weblate-hello",
    "template": "",
    "new_base": "",
    "url": "http://example.com/api/components/hello/weblate/",
    "vcs": "git",
    "web_url": "http://example.com/projects/hello/weblate/"
}
GET /api/projects/(string: project)/languages/

Returns paginated statistics for all languages within a project.

バージョン 3.8 で追加.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Response JSON Object
  • results (array) -- array of translation statistics objects

  • language (string) -- language name

  • code (string) -- language code

  • total (int) -- total number of strings

  • translated (int) -- number of translated strings

  • translated_percent (float) -- percentage of translated strings

  • total_words (int) -- total number of words

  • translated_words (int) -- number of translated words

  • words_percent (float) -- percentage of translated words

GET /api/projects/(string: project)/statistics/

Returns statistics for a project.

バージョン 3.8 で追加.

Parameters
  • project (string) -- プロジェクト URL スラッグ

Response JSON Object
  • total (int) -- total number of strings

  • translated (int) -- number of translated strings

  • translated_percent (float) -- percentage of translated strings

  • total_words (int) -- total number of words

  • translated_words (int) -- number of translated words

  • words_percent (float) -- percentage of translated words

コンポーネント

GET /api/components/

Returns a list of translation components.

参考

Component object attributes are documented at GET /api/components/(string:project)/(string:component)/.

GET /api/components/(string: project)/(string: component)/

Returns information about translation component.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object

Example JSON data:

{
    "branch": "master",
    "file_format": "po",
    "filemask": "po/*.po",
    "git_export": "",
    "license": "",
    "license_url": "",
    "name": "Weblate",
    "slug": "weblate",
    "project": {
        "name": "Hello",
        "slug": "hello",
        "source_language": {
            "code": "en",
            "direction": "ltr",
            "name": "English",
            "url": "http://example.com/api/languages/en/",
            "web_url": "http://example.com/languages/en/"
        },
        "url": "http://example.com/api/projects/hello/",
        "web": "https://weblate.org/",
        "web_url": "http://example.com/projects/hello/"
    },
    "source_language": {
        "code": "en",
        "direction": "ltr",
        "name": "English",
        "url": "http://example.com/api/languages/en/",
        "web_url": "http://example.com/languages/en/"
    },
    "repo": "file:///home/nijel/work/weblate-hello",
    "template": "",
    "new_base": "",
    "url": "http://example.com/api/components/hello/weblate/",
    "vcs": "git",
    "web_url": "http://example.com/projects/hello/weblate/"
}
PATCH /api/components/(string: project)/(string: component)/

Edit a component by a PATCH request.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • source_language (string) -- Project source language code (optional)

Request JSON Object
  • name (string) -- name of component

  • slug (string) -- コンポーネントのスラッグ

  • repo (string) -- VCS repository URL

CURL example:

curl \
    --data-binary '{"name": "new name"}' \
    -H "Content-Type: application/json" \
    -H "Authorization: Token TOKEN" \
    PATCH http://example.com/api/projects/hello/components/

JSON request example:

PATCH /api/projects/hello/components/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{
    "name": "new name"
}

JSON response example:

HTTP/1.0 200 OK
Date: Tue, 12 Apr 2016 09:32:50 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, POST, HEAD, OPTIONS

{
    "branch": "master",
    "file_format": "po",
    "filemask": "po/*.po",
    "git_export": "",
    "license": "",
    "license_url": "",
    "name": "new name",
    "slug": "weblate",
    "project": {
        "name": "Hello",
        "slug": "hello",
        "source_language": {
            "code": "en",
            "direction": "ltr",
            "name": "English",
            "url": "http://example.com/api/languages/en/",
            "web_url": "http://example.com/languages/en/"
        },
        "url": "http://example.com/api/projects/hello/",
        "web": "https://weblate.org/",
        "web_url": "http://example.com/projects/hello/"
    },
    "repo": "file:///home/nijel/work/weblate-hello",
    "template": "",
    "new_base": "",
    "url": "http://example.com/api/components/hello/weblate/",
    "vcs": "git",
    "web_url": "http://example.com/projects/hello/weblate/"
}
PUT /api/components/(string: project)/(string: component)/

Edit a component by a PUT request.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Request JSON Object
  • branch (string) -- VCS repository branch

  • file_format (string) -- file format of translations

  • filemask (string) -- mask of translation files in the repository

  • name (string) -- name of component

  • slug (string) -- コンポーネントのスラッグ

  • repo (string) -- VCS repository URL

  • template (string) -- base file for monolingual translations

  • new_base (string) -- base file for adding new translations

  • vcs (string) -- version control system

DELETE /api/components/(string: project)/(string: component)/

バージョン 3.9 で追加.

Deletes a component.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

GET /api/components/(string: project)/(string: component)/changes/

Returns a list of component changes. This is essentially a component scoped GET /api/changes/ accepting same params.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object
GET /api/components/(string: project)/(string: component)/screenshots/

Returns a list of component screenshots.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object
GET /api/components/(string: project)/(string: component)/lock/

Returns component lock status.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object
  • locked (boolean) -- whether component is locked for updates

Example JSON data:

{
    "locked": false
}
POST /api/components/(string: project)/(string: component)/lock/

Sets component lock status.

Response is same as GET /api/components/(string:project)/(string:component)/lock/.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Request JSON Object
  • lock -- Boolean whether to lock or not.

CURL example:

curl \
    -d lock=true \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/components/hello/weblate/repository/

JSON request example:

POST /api/components/hello/weblate/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{"lock": true}

JSON response example:

HTTP/1.0 200 OK
Date: Tue, 12 Apr 2016 09:32:50 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, POST, HEAD, OPTIONS

{"locked":true}
GET /api/components/(string: project)/(string: component)/repository/

Returns information about VCS repository status.

The response is same as for GET /api/projects/(string:project)/repository/.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object
  • needs_commit (boolean) -- whether there are any pending changes to commit

  • needs_merge (boolean) -- whether there are any upstream changes to merge

  • needs_push (boolean) -- whether there are any local changes to push

  • remote_commit (string) -- Remote commit information

  • status (string) -- VCS repository status as reported by VCS

  • merge_failure -- Text describing merge failure or null if there is none

POST /api/components/(string: project)/(string: component)/repository/

Performs the given operation on a VCS repository.

See POST /api/projects/(string:project)/repository/ for documentation.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Request JSON Object
  • operation (string) -- Operation to perform: one of push, pull, commit, reset, cleanup

Response JSON Object
  • result (boolean) -- result of the operation

CURL example:

curl \
    -d operation=pull \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/components/hello/weblate/repository/

JSON request example:

POST /api/components/hello/weblate/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{"operation":"pull"}

JSON response example:

HTTP/1.0 200 OK
Date: Tue, 12 Apr 2016 09:32:50 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, POST, HEAD, OPTIONS

{"result":true}
GET /api/components/(string: project)/(string: component)/monolingual_base/

Downloads base file for monolingual translations.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

GET /api/components/(string: project)/(string: component)/new_template/

Downloads template file for new translations.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

GET /api/components/(string: project)/(string: component)/translations/

Returns a list of translation objects in the given component.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object
POST /api/components/(string: project)/(string: component)/translations/

Creates new translation in the given component.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Request JSON Object
Response JSON Object
  • result (object) -- new translation object created

CURL example:

curl \
    -d language_code=cs \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/projects/hello/components/

JSON request example:

POST /api/projects/hello/components/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20

{"language_code": "cs"}

JSON response example:

HTTP/1.0 200 OK
Date: Tue, 12 Apr 2016 09:32:50 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, POST, HEAD, OPTIONS

{
    "failing_checks": 0,
    "failing_checks_percent": 0,
    "failing_checks_words": 0,
    "filename": "po/cs.po",
    "fuzzy": 0,
    "fuzzy_percent": 0.0,
    "fuzzy_words": 0,
    "have_comment": 0,
    "have_suggestion": 0,
    "is_template": false,
    "is_source": false,
    "language": {
        "code": "cs",
        "direction": "ltr",
        "name": "Czech",
        "url": "http://example.com/api/languages/cs/",
        "web_url": "http://example.com/languages/cs/"
    },
    "language_code": "cs",
    "id": 125,
    "last_author": null,
    "last_change": null,
    "share_url": "http://example.com/engage/hello/cs/",
    "total": 4,
    "total_words": 15,
    "translate_url": "http://example.com/translate/hello/weblate/cs/",
    "translated": 0,
    "translated_percent": 0.0,
    "translated_words": 0,
    "url": "http://example.com/api/translations/hello/weblate/cs/",
    "web_url": "http://example.com/projects/hello/weblate/cs/"
}
GET /api/components/(string: project)/(string: component)/statistics/

Returns paginated statistics for all translations within component.

バージョン 2.7 で追加.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

Response JSON Object

翻訳

GET /api/translations/

Returns a list of translations.

参考

Translation object attributes are documented at GET /api/translations/(string:project)/(string:component)/(string:language)/.

GET /api/translations/(string: project)/(string: component)/(string: language)/

Returns information about a translation.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Response JSON Object

Example JSON data:

{
    "component": {
        "branch": "master",
        "file_format": "po",
        "filemask": "po/*.po",
        "git_export": "",
        "license": "",
        "license_url": "",
        "name": "Weblate",
        "new_base": "",
        "project": {
            "name": "Hello",
            "slug": "hello",
            "source_language": {
                "code": "en",
                "direction": "ltr",
                "name": "English",
                "url": "http://example.com/api/languages/en/",
                "web_url": "http://example.com/languages/en/"
            },
            "url": "http://example.com/api/projects/hello/",
            "web": "https://weblate.org/",
            "web_url": "http://example.com/projects/hello/"
        },
        "repo": "file:///home/nijel/work/weblate-hello",
        "slug": "weblate",
        "template": "",
        "url": "http://example.com/api/components/hello/weblate/",
        "vcs": "git",
        "web_url": "http://example.com/projects/hello/weblate/"
    },
    "failing_checks": 3,
    "failing_checks_percent": 75.0,
    "failing_checks_words": 11,
    "filename": "po/cs.po",
    "fuzzy": 0,
    "fuzzy_percent": 0.0,
    "fuzzy_words": 0,
    "have_comment": 0,
    "have_suggestion": 0,
    "is_template": false,
    "language": {
        "code": "cs",
        "direction": "ltr",
        "name": "Czech",
        "url": "http://example.com/api/languages/cs/",
        "web_url": "http://example.com/languages/cs/"
    },
    "language_code": "cs",
    "last_author": "Weblate Admin",
    "last_change": "2016-03-07T10:20:05.499",
    "revision": "7ddfafe6daaf57fc8654cc852ea6be212b015792",
    "share_url": "http://example.com/engage/hello/cs/",
    "total": 4,
    "total_words": 15,
    "translate_url": "http://example.com/translate/hello/weblate/cs/",
    "translated": 4,
    "translated_percent": 100.0,
    "translated_words": 15,
    "url": "http://example.com/api/translations/hello/weblate/cs/",
    "web_url": "http://example.com/projects/hello/weblate/cs/"
}
DELETE /api/translations/(string: project)/(string: component)/(string: language)/

バージョン 3.9 で追加.

Deletes a translation.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

GET /api/translations/(string: project)/(string: component)/(string: language)/changes/

Returns a list of translation changes. This is essentially a translations-scoped GET /api/changes/ accepting the same parameters.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Response JSON Object
GET /api/translations/(string: project)/(string: component)/(string: language)/units/

Returns a list of translation units.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

  • q (string) -- Search query string 検索 (optional)

Response JSON Object
POST /api/translations/(string: project)/(string: component)/(string: language)/units/

Add new monolingual unit.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Request JSON Object
  • key (string) -- Name of translation unit

  • value (string) -- The translation unit value

POST /api/translations/(string: project)/(string: component)/(string: language)/autotranslate/

Trigger automatic translation.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Request JSON Object
  • mode (string) -- 自動翻訳モード

  • filter_type (string) -- Automatic translation filter type

  • auto_source (string) -- 自動翻訳の参照元

  • component (string) -- プロジェクトの共有翻訳メモリに協力を有効にして、追加コンポーネントにアクセスします。

  • engines (string) -- 機械翻訳エンジン

  • threshold (string) -- スコアしきい値

GET /api/translations/(string: project)/(string: component)/(string: language)/file/

Download current translation file as stored in VCS (without format parameter) or as converted to a standard format (currently supported: Gettext PO, MO, XLIFF and TBX).

注釈

This API endpoint uses different logic for output than rest of API as it operates on whole file rather than on data. Set of accepted format parameter differs and without such parameter you get translation file as stored in VCS.

Query Parameters
  • format -- File format to use; if not specified no format conversion happens; supported file formats: po, mo, xliff, xliff11, tbx, csv, xlsx, json, aresource, strings

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

POST /api/translations/(string: project)/(string: component)/(string: language)/file/

Upload new file with translations.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Form Parameters
  • string conflicts -- How to deal with conflicts (ignore, replace-translated or replace-approved)

  • file file -- Uploaded file

  • string email -- 翻訳者のメールアドレス

  • string author -- 翻訳者名

  • string method -- アップロードの方法 (translateapprovesuggestfuzzyreplace, source)、参照 see インポート方法

  • string fuzzy -- Fuzzy (marked for edit) strings processing (empty, process, approve)

CURL example:

curl -X POST \
    -F file=@strings.xml \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/translations/hello/android/cs/file/
GET /api/translations/(string: project)/(string: component)/(string: language)/repository/

Returns information about VCS repository status.

The response is same as for GET /api/components/(string:project)/(string:component)/repository/.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

POST /api/translations/(string: project)/(string: component)/(string: language)/repository/

Performs given operation on the VCS repository.

See POST /api/projects/(string:project)/repository/ for documentation.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Request JSON Object
  • operation (string) -- Operation to perform: one of push, pull, commit, reset, cleanup

Response JSON Object
  • result (boolean) -- result of the operation

GET /api/translations/(string: project)/(string: component)/(string: language)/statistics/

Returns detailed translation statistics.

バージョン 2.7 で追加.

Parameters
  • project (string) -- プロジェクト URL スラッグ

  • component (string) -- コンポーネント URL スラッグ

  • language (string) -- Translation language code

Response JSON Object
  • code (string) -- language code

  • failing (int) -- number of failing checks

  • failing_percent (float) -- percentage of failing checks

  • fuzzy (int) -- あいまいな(要編集付き)文字列の数

  • fuzzy_percent (float) -- percentage of fuzzy (marked for edit) strings

  • total_words (int) -- total number of words

  • translated_words (int) -- number of translated words

  • last_author (string) -- name of last author

  • last_change (timestamp) -- date of last change

  • name (string) -- language name

  • total (int) -- total number of strings

  • translated (int) -- number of translated strings

  • translated_percent (float) -- percentage of translated strings

  • url (string) -- URL to access the translation (engagement URL)

  • url_translate (string) -- URL to access the translation (real translation URL)

Units

バージョン 2.10 で追加.

GET /api/units/

Returns list of translation units.

参考

Unit object attributes are documented at GET /api/units/(int:id)/.

GET /api/units/(int: id)/

バージョン 4.3 で変更: The target and source are now arrays to properly handle plural strings.

Returns information about translation unit.

Parameters
  • id (int) -- Unit ID

Response JSON Object
  • translation (string) -- URL of a related translation object

  • source (array) -- source string

  • previous_source (string) -- previous source string used for fuzzy matching

  • target (array) -- target string

  • id_hash (string) -- unique identifier of the unit

  • content_hash (string) -- unique identifier of the source string

  • location (string) -- location of the unit in source code

  • context (string) -- translation unit context

  • note (string) -- translation unit note

  • flags (string) -- translation unit flags

  • state (int) -- unit state, 0 - not translated, 10 - needs editing, 20 - translated, 30 - approved, 100 - read only

  • fuzzy (boolean) -- ユニットが "fuzzy" もしは査読用にマークされているか

  • translated (boolean) -- 単位が翻訳されているかどうか

  • approved (boolean) -- 翻訳が承認されているかどうか

  • position (int) -- unit position in translation file

  • has_suggestion (boolean) -- ユニットに提案があるかどうか

  • has_comment (boolean) -- ユニットにコメントがあるかどうか

  • has_failing_check (boolean) -- ユニットに検査で不合格となったものがあるか

  • num_words (int) -- number of source words

  • priority (int) -- translation priority; 100 is default

  • id (int) -- unit identifier

  • explanation (string) -- String explanation, available on source units, see Additional info on source strings

  • extra_flags (string) -- 原文ユニットで使用可能な追加の文字列フラグ、参照 動作のカスタマイズ

  • web_url (string) -- URL where the unit can be edited

  • souce_unit (string) -- Source unit link; see GET /api/units/(int:id)/

PATCH /api/units/(int: id)/

バージョン 4.3 で追加.

翻訳ユニットを部分的に更新します。

Parameters
  • id (int) -- Unit ID

Request JSON Object
  • state (int) -- unit state, 0 - not translated, 10 - needs editing, 20 - translated, 30 - approved (need review workflow enabled, see 専任の査読者)

  • target (array) -- target string

  • explanation (string) -- String explanation, available on source units, see Additional info on source strings

  • extra_flags (string) -- 原文ユニットで使用可能な追加の文字列フラグ、参照 動作のカスタマイズ

PUT /api/units/(int: id)/

バージョン 4.3 で追加.

翻訳ユニットをすべて更新します。

Parameters
  • id (int) -- Unit ID

Request JSON Object
  • state (int) -- unit state, 0 - not translated, 10 - needs editing, 20 - translated, 30 - approved (need review workflow enabled, see 専任の査読者)

  • target (array) -- target string

  • explanation (string) -- String explanation, available on source units, see Additional info on source strings

  • extra_flags (string) -- 原文ユニットで使用可能な追加の文字列フラグ、参照 動作のカスタマイズ

DELETE /api/units/(int: id)/

バージョン 4.3 で追加.

翻訳ユニットを削除します。

Parameters
  • id (int) -- Unit ID

変更

バージョン 2.10 で追加.

GET /api/changes/

バージョン 4.1 で変更: 変更のフィルター処理は 4.1 リリースで導入しました。

Returns a list of translation changes.

参考

Change object attributes are documented at GET /api/changes/(int:id)/.

Query Parameters
  • user (string) -- Username of user to filters

  • action (int) -- Action to filter, can be used several times

  • timestamp_after (timestamp) -- ISO 8601 formatted timestamp to list changes after

  • timestamp_before (timestamp) -- ISO 8601 formatted timestamp to list changes before

GET /api/changes/(int: id)/

Returns information about translation change.

Parameters
  • id (int) -- Change ID

Response JSON Object
  • unit (string) -- URL of a related unit object

  • translation (string) -- URL of a related translation object

  • component (string) -- URL of a related component object

  • glossary_term (string) -- URL of a related glossary term object

  • user (string) -- URL of a related user object

  • author (string) -- URL of a related author object

  • timestamp (timestamp) -- event timestamp

  • action (int) -- numeric identification of action

  • action_name (string) -- text description of action

  • target (string) -- event changed text or detail

  • id (int) -- change identifier

スクリーンショット

バージョン 2.14 で追加.

GET /api/screenshots/

Returns a list of screenshot string information.

参考

Screenshot object attributes are documented at GET /api/screenshots/(int:id)/.

GET /api/screenshots/(int: id)/

Returns information about screenshot information.

Parameters
  • id (int) -- Screenshot ID

Response JSON Object
GET /api/screenshots/(int: id)/file/

Download the screenshot image.

Parameters
  • id (int) -- Screenshot ID

POST /api/screenshots/(int: id)/file/

Replace screenshot image.

Parameters
  • id (int) -- Screenshot ID

Form Parameters
  • file image -- Uploaded file

CURL example:

curl -X POST \
    -F image=@image.png \
    -H "Authorization: Token TOKEN" \
    http://example.com/api/screenshots/1/file/
POST /api/screenshots/(int: id)/units/

Associate source string with screenshot.

Parameters
  • id (int) -- Screenshot ID

Form Parameters
  • string unit_id -- Unit ID

Response JSON Object
DELETE /api/screenshots/(int: id)/units/(int: unit_id)

スクリーンショットと原文の関連付けを削除します。

Parameters
  • id (int) -- Screenshot ID

  • unit_id -- 原文ユニット ID

POST /api/screenshots/

Creates a new screenshot.

Form Parameters
  • file image -- Uploaded file

  • string name -- スクリーンショットの名前

  • string project_slug -- プロジェクトのスラッグ

  • string component_slug -- コンポーネントのスラッグ

  • string language_code -- 言語コード

Response JSON Object
PATCH /api/screenshots/(int: id)/

スクリーンショットに関する部分的な情報を編集します。

Parameters
  • id (int) -- Screenshot ID

Response JSON Object
PUT /api/screenshots/(int: id)/

スクリーンショットのすべての情報を編集します。

Parameters
  • id (int) -- Screenshot ID

Response JSON Object
DELETE /api/screenshots/(int: id)/

スクリーンショットを削除します。

Parameters
  • id (int) -- Screenshot ID

アドオン

バージョン 4.4.1 で追加.

GET /api/addons/

Returns a list of addons.

参考

Addon object attributes are documented at GET /api/addons/(int:id)/.

GET /api/addons/(int: id)/

Returns information about addon information.

Parameters
  • id (int) -- Addon ID

Response JSON Object
  • name (string) -- name of an addon

  • component (string) -- URL of a related component object

  • configuration (object) -- Optional addon configuration

POST /api/components/(string: project)/(string: component)/addons/

Creates a new addon.

Parameters
  • project_slug (string) -- プロジェクトのスラッグ

  • component_slug (string) -- コンポーネントのスラッグ

Request JSON Object
  • name (string) -- name of an addon

  • configuration (object) -- Optional addon configuration

PATCH /api/addons/(int: id)/

Edit partial information about addon.

Parameters
  • id (int) -- Addon ID

Response JSON Object
  • configuration (object) -- Optional addon configuration

PUT /api/addons/(int: id)/

Edit full information about addon.

Parameters
  • id (int) -- Addon ID

Response JSON Object
  • configuration (object) -- Optional addon configuration

DELETE /api/addons/(int: id)/

Delete addon.

Parameters
  • id (int) -- Addon ID

コンポーネント リストのセット

バージョン 4.0 で追加.

GET /api/component-lists/

コンポーネント リストのセットの一覧を返す。

参考

コンポーネント リストのセットのオブジェクト属性は、GET /api/component-lists/(str:slug)/ に記載されています。

GET /api/component-lists/(str: slug)/

Returns information about component list.

Parameters
  • slug (string) -- コンポーネント リストのスラッグ

Response JSON Object
  • name (string) -- name of a component list

  • slug (string) -- コンポーネント リストのスラッグ

  • show_dashboard (boolean) -- whether to show it on a dashboard

  • components (array) -- link to associated components; see GET /api/components/(string:project)/(string:component)/

  • auto_assign (array) -- automatic assignment rules

PUT /api/component-lists/(str: slug)/

Changes the component list parameters.

Parameters
  • slug (string) -- コンポーネント リストのスラッグ

Request JSON Object
  • name (string) -- name of a component list

  • slug (string) -- コンポーネント リストのスラッグ

  • show_dashboard (boolean) -- whether to show it on a dashboard

PATCH /api/component-lists/(str: slug)/

Changes the component list parameters.

Parameters
  • slug (string) -- コンポーネント リストのスラッグ

Request JSON Object
  • name (string) -- name of a component list

  • slug (string) -- コンポーネント リストのスラッグ

  • show_dashboard (boolean) -- whether to show it on a dashboard

DELETE /api/component-lists/(str: slug)/

Deletes the component list.

Parameters
  • slug (string) -- コンポーネント リストのスラッグ

POST /api/component-lists/(str: slug)/components/

Associate component with a component list.

Parameters
  • slug (string) -- コンポーネント リストのスラッグ

Form Parameters
  • string component_id -- Component ID

DELETE /api/component-lists/(str: slug)/components/(str: component_slug)

Disassociate a component from the component list.

Parameters
  • slug (string) -- コンポーネント リストのスラッグ

  • component_slug (string) -- コンポーネントのスラッグ

用語集

GET /api/glossary/

Returns a list of all glossaries which are associated with a project that user has access to.

参考

Language object attributes are documented at GET /api/languages/(string:language)/.

GET /api/glossary/(int: id)/

用語集の情報を返します。

Parameters
  • id (int) -- 用語集 id

Response JSON Object
  • name (string) -- 言語コード

  • color (string) -- テキストの方向

  • source_language (object) -- Object of language plural information

  • projects (array) -- link to associated projects; see GET /api/projects/(string:project)/

Example JSON data:

{
    "name": "Hello",
    "id": 1,
    "color": "silver",
    "source_language": {
        "code": "en",
        "name": "English",
        "plural": {
            "id": 75,
            "source": 0,
            "number": 2,
            "formula": "n != 1",
            "type": 1
        },
        "aliases": [
            "english",
            "en_en",
            "base",
            "source",
            "eng"
        ],
        "direction": "ltr",
        "web_url": "http://example.com/languages/en/",
        "url": "http://example.com/api/languages/en/",
        "statistics_url": "http://example.com/api/languages/en/statistics/"
    },
    "project": {
        "name": "Hello",
        "slug": "hello",
        "id": 1,
        "source_language": {
            "code": "en",
            "name": "English",
            "plural": {
                "id": 75,
                "source": 0,
                "number": 2,
                "formula": "n != 1",
                "type": 1
            },
            "aliases": [
                "english",
                "en_en",
                "base",
                "source",
                "eng"
            ],
            "direction": "ltr",
            "web_url": "http://example.com/languages/en/",
            "url": "http://example.com/api/languages/en/",
            "statistics_url": "http://example.com/api/languages/en/statistics/"
        },
        "web_url": "http://example.com/projects/demo1/",
        "url": "http://example.com/api/projects/demo1/",
        "components_list_url": "http://example.com/api/projects/demo1/components/",
        "repository_url": "http://example.com/api/projects/demo1/repository/",
        "statistics_url": "http://example.com/api/projects/demo1/statistics/",
        "changes_list_url": "http://example.com/api/projects/demo1/changes/",
        "languages_url": "http://example.com/api/projects/demo1/languages/"
    },
    "projects_url": "http://example.com/api/glossary/7/projects/",
    "terms_url": "http://example.com/api/glossary/7/terms/",
    "url": "http://example.com/api/glossary/7/"
}
PUT /api/glossary/(int: id)/

用語集のパラメーターを変更します。

Parameters
  • id (int) -- 用語集 id

Request JSON Object
  • name (string) -- 言語名

  • color (string) -- Language direction

  • source_language (object) -- Language plural details

PATCH /api/glossary/(int: id)/

用語集のパラメーターを変更します。

Parameters
  • id (int) -- 用語集 id

Request JSON Object
  • name (string) -- 言語名

  • color (string) -- Language direction

  • source_language (object) -- Language plural details

DELETE /api/glossary/(int: id)/

用語集を削除します。

Parameters
  • id (int) -- 用語集 id

GET /api/glossary/(int: id)/projects/

Returns projects linked with a glossary.

Parameters
  • id (int) -- 用語集 id

Response JSON Object
POST /api/glossary/(int: id)/projects/

プロジェクトを用語集に関連付けます。

Parameters
  • id (int) -- 用語集 id

Form Parameters
  • string project_slug -- プロジェクトのスラッグ

DELETE /api/glossary/(int: id)/projects/

用語集とプロジェクトの関連付けを削除します。

Parameters
  • id (int) -- 用語集 id

Form Parameters
  • string project_slug -- プロジェクトのスラッグ

GET /api/glossary/(int: id)/terms/

用語集の用語を一覧表示します。

Parameters
  • id (int) -- 用語集 id

POST /api/glossary/(int: id)/terms/

用語を用語集に関連付けます。

Parameters
  • id (int) -- 用語集 id

Request JSON Object
  • language (object) -- 用語の言語

  • source (string) -- 用語の原文

  • target (string) -- 用語のターゲット文字列

GET /api/glossary/(int: id)/terms/(int: term_id)/

用語集に関連付けられた用語を取得します。

Parameters
  • id (int) -- 用語集 id

  • term_id (int) -- ID of term

PUT /api/glossary/(int: id)/terms/(int: term_id)/

用語集に関連付けられた用語を編集します。

Parameters
  • id (int) -- 用語集 id

  • term_id (int) -- ID of term

Request JSON Object
  • language (object) -- 用語の言語

  • source (string) -- 用語の原文

  • target (string) -- 用語のターゲット文字列

PATCH /api/glossary/(int: id)/terms/(int: term_id)/

用語集に関連付けられた用語を編集します。

Parameters
  • id (int) -- 用語集 id

  • term_id (int) -- ID of term

Request JSON Object
  • language (object) -- 用語の言語

  • source (string) -- 用語の原文

  • target (string) -- 用語のターゲット文字列

DELETE /api/glossary/(int: id)/terms/(int: term_id)/

Delete a term associated with a glossary.

Parameters
  • id (int) -- 用語集 id

  • term_id (int) -- ID of term

Tasks

バージョン 4.4 で追加.

GET /api/tasks/

タスクの一覧は現在使用できません。

GET /api/tasks/(str: uuid)/

タスクに関する情報を返します

Parameters
  • uuid (string) -- Task UUID

Response JSON Object
  • completed (boolean) -- タスクが完了したかどうか

  • progress (int) -- Task progress in percent

  • result (object) -- タスクの結果または進捗状況の詳細

  • log (string) -- タスクの履歴

通知フック

Notification hooks allow external applications to notify Weblate that the VCS repository has been updated.

You can use repository endpoints for projects, components and translations to update individual repositories; see POST /api/projects/(string:project)/repository/ for documentation.

GET /hooks/update/(string: project)/(string: component)/

バージョン 2.6 で非推奨: Please use POST /api/components/(string:project)/(string:component)/repository/ instead which works properly with authentication for ACL limited projects.

Triggers update of a component (pulling from VCS and scanning for translation changes).

GET /hooks/update/(string: project)/

バージョン 2.6 で非推奨: Please use POST /api/projects/(string:project)/repository/ instead which works properly with authentication for ACL limited projects.

Triggers update of all components in a project (pulling from VCS and scanning for translation changes).

POST /hooks/github/

Special hook for handling GitHub notifications and automatically updating matching components.

注釈

GitHub includes direct support for notifying Weblate: enable Weblate service hook in repository settings and set the URL to the URL of your Weblate installation.

参考

Automatically receiving changes from GitHub

For instruction on setting up GitHub integration

https://docs.github.com/en/free-pro-team@latest/github/extending-github/about-webhooks

Generic information about GitHub Webhooks

ENABLE_HOOKS

For enabling hooks for whole Weblate

POST /hooks/gitlab/

Special hook for handling GitLab notifications and automatically updating matching components.

参考

Automatically receiving changes from GitLab

For instruction on setting up GitLab integration

https://docs.gitlab.com/ce/user/project/integrations/webhooks.html

Generic information about GitLab Webhooks

ENABLE_HOOKS

For enabling hooks for whole Weblate

POST /hooks/bitbucket/

Special hook for handling Bitbucket notifications and automatically updating matching components.

参考

Automatically receiving changes from Bitbucket

For instruction on setting up Bitbucket integration

https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/

Generic information about Bitbucket Webhooks

ENABLE_HOOKS

For enabling hooks for whole Weblate

POST /hooks/pagure/

バージョン 3.3 で追加.

Pagure 通知を処理し、一致するコンポーネントを自動的に更新するための特別なフック。

参考

Pagure からの変更を自動的に受信

Pagure 統合の設定手順について

https://docs.pagure.org/pagure/usage/using_webhooks.html

Pagure WEB フックに関する一般的な情報

ENABLE_HOOKS

For enabling hooks for whole Weblate

POST /hooks/azure/

バージョン 3.8 で追加.

Special hook for handling Azure Repos notifications and automatically updating matching components.

参考

Automatically receiving changes from Azure Repos

For instruction on setting up Azure integration

https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/webhooks?view=azure-devops

Generic information about Azure Repos Web Hooks

ENABLE_HOOKS

For enabling hooks for whole Weblate

POST /hooks/gitea/

バージョン 3.9 で追加.

Special hook for handling Gitea Webhook notifications and automatically updating matching components.

参考

Automatically receiving changes from Gitea Repos

For instruction on setting up Gitea integration

https://docs.gitea.io/en-us/webhooks/

Generic information about Gitea Webhooks

ENABLE_HOOKS

For enabling hooks for whole Weblate

POST /hooks/gitee/

バージョン 3.9 で追加.

Special hook for handling Gitee Webhook notifications and automatically updating matching components.

参考

Automatically receiving changes from Gitee Repos

For instruction on setting up Gitee integration

https://gitee.com/help/categories/40

Generic information about Gitee Webhooks

ENABLE_HOOKS

For enabling hooks for whole Weblate

Exports

Weblate provides various exports to allow you to further process the data.

GET /exports/stats/(string: project)/(string: component)/
Query Parameters
  • format (string) -- Output format: either json or csv

バージョン 2.6 で非推奨: Please use GET /api/components/(string:project)/(string:component)/statistics/ and GET /api/translations/(string:project)/(string:component)/(string:language)/statistics/ instead; it allows access to ACL controlled projects as well.

Retrieves statistics for given component in given format.

Example request:

GET /exports/stats/weblate/master/ HTTP/1.1
Host: example.com
Accept: application/json, text/javascript

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
    {
        "code": "cs",
        "failing": 0,
        "failing_percent": 0.0,
        "fuzzy": 0,
        "fuzzy_percent": 0.0,
        "last_author": "Michal Čihař",
        "last_change": "2012-03-28T15:07:38+00:00",
        "name": "Czech",
        "total": 436,
        "total_words": 15271,
        "translated": 436,
        "translated_percent": 100.0,
        "translated_words": 3201,
        "url": "http://hosted.weblate.org/engage/weblate/cs/",
        "url_translate": "http://hosted.weblate.org/projects/weblate/master/cs/"
    },
    {
        "code": "nl",
        "failing": 21,
        "failing_percent": 4.8,
        "fuzzy": 11,
        "fuzzy_percent": 2.5,
        "last_author": null,
        "last_change": null,
        "name": "Dutch",
        "total": 436,
        "total_words": 15271,
        "translated": 319,
        "translated_percent": 73.2,
        "translated_words": 3201,
        "url": "http://hosted.weblate.org/engage/weblate/nl/",
        "url_translate": "http://hosted.weblate.org/projects/weblate/master/nl/"
    },
    {
        "code": "el",
        "failing": 11,
        "failing_percent": 2.5,
        "fuzzy": 21,
        "fuzzy_percent": 4.8,
        "last_author": null,
        "last_change": null,
        "name": "Greek",
        "total": 436,
        "total_words": 15271,
        "translated": 312,
        "translated_percent": 71.6,
        "translated_words": 3201,
        "url": "http://hosted.weblate.org/engage/weblate/el/",
        "url_translate": "http://hosted.weblate.org/projects/weblate/master/el/"
    }
]

RSS フィード

Changes in translations are exported in RSS feeds.

GET /exports/rss/(string: project)/(string: component)/(string: language)/

Retrieves RSS feed with recent changes for a translation.

GET /exports/rss/(string: project)/(string: component)/

Retrieves RSS feed with recent changes for a component.

GET /exports/rss/(string: project)/

Retrieves RSS feed with recent changes for a project.

GET /exports/rss/language/(string: language)/

Retrieves RSS feed with recent changes for a language.

GET /exports/rss/

Retrieves RSS feed with recent changes for Weblate instance.