Weblate ウェブ API

REST API

バージョン 2.6 で追加: この API は Weblate 2.6 以降で利用可能です。

API は /api/ の URL から利用可能です。これは Django REST framework に基づいています。URL から直接使うこともできますし、Weblate クライアント を通して使うこともできます。

認証と共通パラメータ

公開プロジェクトの API は認証なしに使うことができますが、認証されていないリクエストの数は大きく制限されていますので(初期設定では1日あたり100リクエストまでです)、認証を使うことをおすすめします。認証はトークンを利用して行われます。トークンはあなたのプロファイルページで入手できますので、これを Authorization ヘッダに含めてください。

ANY /

以下のヘッダー、ステータスコード、パラメータは、APIに対するリクエスト行為として一般的なものであり、すべてのエントリーポイントに対して同様に適用されます。

クエリ・パラメータ:
  • format -- レスポンスのフォーマット(Accept を上書きします)。可能な値は REST framework の設定に依存しますが、初期値では jsonapi がサポートされています。後者は API のためのウェブブラウザ用インターフェースを提供します。
リクエスト・ヘッダ:
レスポンス・ヘッダ:
レスポンス JSON オブジェクト:
 
  • 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
ステータス・コード:

認証の例

リクエスト例

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

レスポンス例

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 例

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

パラメータ渡しの例

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

フォームリクエスト例

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 リクエスト例

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 例

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

CURL JSON 例

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

レート制限

The API requests are rate limited; the default configuration limits it to 100 requests per day for anonymous users and 1000 requests per day for authenticated users.

Rate limiting can be adjusted in the settings.py; see Throttling in Django REST framework documentation for more details how to configure it.

API エントリーポイント

GET /api/

API のルート・エントリーポイントです。

リクエスト例

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

レスポンス例

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/"
}

言語

GET /api/languages/

すべての言語のリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

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

Returns information about a language.

Parameters:
  • language (string) -- Language code
レスポンス JSON オブジェクト:
 
  • code (string) -- Language code
  • direction (string) -- Text direction

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

Example JSON data:

{
    "code": "en",
    "direction": "ltr",
    "name": "English",
    "url": "http://example.com/api/languages/en/",
    "web_url": "http://example.com/languages/en/"
}

プロジェクト

GET /api/projects/

すべてのプロジェクトのリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

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

Returns information about a project.

Parameters:
  • project (string) -- Project URL slug
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

Example JSON data:

{
    "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/"
}
GET /api/projects/(string: project)/changes/

Returns a list of project changes.

Parameters:
  • project (string) -- Project URL slug
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
レスポンス JSON オブジェクト:
 
  • 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

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
Request JSON Object:
 
  • operation (string) -- Operation to perform: one of push, pull, commit, reset, cleanup
レスポンス JSON オブジェクト:
 
  • result (boolean) -- result of the operation

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

CURL 例

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

JSON リクエスト例

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) -- Project URL slug
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Returns paginated statistics for all languages within a project.

バージョン 2.10 で追加.

Parameters:
  • project (string) -- Project URL slug
レスポンス JSON オブジェクト:
 
  • 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/components/

翻訳コンポーネントのリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
  • component (string) -- Component URL slug
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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/"
    },
    "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/components/(string: project)/(string: component)/changes/

Returns a list of component changes.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Returns component lock status.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
レスポンス JSON オブジェクト:
 
  • locked (boolean) -- whether component is locked for updates

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
  • component (string) -- Component URL slug
Request JSON Object:
 
  • lock -- Boolean whether to lock or not.

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
  • component (string) -- Component URL slug
レスポンス JSON オブジェクト:
 
  • 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

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
  • component (string) -- Component URL slug
Request JSON Object:
 
  • operation (string) -- Operation to perform: one of push, pull, commit, reset, cleanup
レスポンス JSON オブジェクト:
 
  • result (boolean) -- result of the operation

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Downloads base file for monolingual translations.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Downloads template file for new translations.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Returns a list of translation objects in the given component.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Returns paginated statistics for all translations within component.

バージョン 2.7 で追加.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
レスポンス JSON オブジェクト:
 

翻訳

GET /api/translations/

翻訳のリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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/"
}
GET /api/translations/(string: project)/(string: component)/(string: language)/changes/

Returns a list of translation changes.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Returns a list of translation units.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code
レスポンス JSON オブジェクト:
 

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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.

クエリ・パラメータ:
  • format -- File format to use; if not specified no format conversion happens; supported file formats: po, mo, xliff, xliff11, tbx
Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Upload new file with translations.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code
Form Parameters:
 
  • boolean overwrite -- Whether to overwrite existing translations (defaults to no)
  • file file -- Uploaded file

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

CURL 例

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) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code
Request JSON Object:
 
  • operation (string) -- Operation to perform: one of push, pull, commit, reset, cleanup
レスポンス JSON オブジェクト:
 
  • result (boolean) -- result of the operation

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

Returns detailed translation statistics.

バージョン 2.7 で追加.

Parameters:
  • project (string) -- Project URL slug
  • component (string) -- Component URL slug
  • language (string) -- Translation language code
レスポンス JSON オブジェクト:
 
  • code (string) -- language code
  • failing (int) -- number of failing checks
  • failing_percent (float) -- percentage of failing checks
  • fuzzy (int) -- number of strings needing review
  • fuzzy_percent (float) -- percentage of strings needing review
  • 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)

ユニット

バージョン 2.10 で追加.

GET /api/units/

翻訳ユニットのリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

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

Returns information about translation unit.

Parameters:
  • pk (int) -- Unit ID
レスポンス JSON オブジェクト:
 
  • translation (string) -- URL of a related translation object
  • source (string) -- source string
  • previous_source (string) -- previous source string used for fuzzy matching
  • target (string) -- 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
  • comment (string) -- translation unit comment
  • flags (string) -- translation unit flags
  • fuzzy (boolean) -- whether unit is fuzzy or marked for review
  • translated (boolean) -- whether unit is translated
  • position (int) -- unit position in translation file
  • has_suggestion (boolean) -- whether unit has suggestions
  • has_comment (boolean) -- whether unit has comments
  • has_failing_check (boolean) -- whether unit has failing checks
  • num_words (int) -- number of source words
  • priority (int) -- translation priority; 100 is default
  • id (int) -- unit identifier
  • web_url (string) -- URL where unit can be edited
  • souce_info (string) -- Source string information link; see GET /api/sources/(int:pk)/

変更履歴

バージョン 2.10 で追加.

GET /api/changes/

Returns a list of translation changes.

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

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

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

Returns information about translation change.

Parameters:
  • pk (int) -- Change ID
レスポンス JSON オブジェクト:
 
  • unit (string) -- URL of a related unit object
  • translation (string) -- URL of a related translation object
  • component (string) -- URL of a related component object
  • dictionary (string) -- URL of a related dictionary 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/sources/

ソース文字列の情報のリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

Sources object attributes are documented at GET /api/sources/(int:pk)/.

GET /api/sources/(int: pk)/

Returns information about source information.

Parameters:
  • pk (int) -- Source information ID
レスポンス JSON オブジェクト:
 
  • id_hash (string) -- unique identifier of the unit
  • component (string) -- URL of a related component object
  • timestamp (timestamp) -- timestamp when source string was first seen by Weblate
  • priority (int) -- source string priority, 100 is default
  • check_flags (string) -- source string flags
  • units (array) -- links to units; see GET /api/units/(int:pk)/
  • screenshots (array) -- links to assigned screenshots; see GET /api/screenshots/(int:pk)/

スクリーンショット

バージョン 2.14 で追加.

GET /api/screenshots/

スクリーンショット文字列の情報のリストを返します。

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

Sources object attributes are documented at GET /api/screenshots/(int:pk)/.

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

Returns information about screenshot information.

Parameters:
  • pk (int) -- Screenshot ID
レスポンス JSON オブジェクト:
 
GET /api/screenshots/(int: pk)/file/

Download the screenshot image.

Parameters:
  • pk (int) -- Screenshot ID
POST /api/screenshots/(int: pk)/file/

Replace screenshot image.

Parameters:
  • pk (int) -- Screenshot ID
Form Parameters:
 
  • file image -- Uploaded file

参考

Additional common headers, parameters and status codes are documented at 認証と共通パラメータ.

CURL 例

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

通知フック

通知フックは外部アプリケーションが VCS リポジトリのアップデートを Weblate に通知することを可能にします。

プロジェクトやコンポーネント、翻訳のためのリポジトリ・エンドポイントを、個々のリポジトリをアップデートするために使うことができます。 POST /api/projects/(string:project)/repository/ のドキュメンテーションを参照してください。

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.

参考

GitHub から自動的に変更を受け取る
For instruction on setting up GitHub integration
https://help.github.com/articles/creating-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://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html
Generic information about Bitbucket Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
POST /hooks/pagure/

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

参考

Automatically receiving changes from Pagure
For instruction on setting up Bitbucket integration
https://docs.pagure.org/pagure/usage/using_webhooks.html
Generic information about Bitbucket Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate

エクスポート

より進んだデータ処理を可能にするために、Weblate は様々なエクスポートを提供しています。

GET /exports/stats/(string: project)/(string: component)/
クエリ・パラメータ:
  • 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 \u010ciha\u0159",
        "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 フィード

翻訳の変更は RSS フィードにエクスポートされます。

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.