Weblate 的 REST API¶
API 可以在 /api/
URL上存取,並且它基於 Django REST framework。您可以直接使用或參考 Weblate 客戶端。
身份驗證和通用參數¶
公開專案 API 不需要身份驗證就可用,儘管沒有身份驗證的請求導致嚴重的瓶頸(預設每天 100 個請求),所以推薦使用身份驗證。身份驗證使用令牌,這可以在您的簡介中得到。在 Authorization
標頭中使用它:
- ANY /¶
對於 API的普通請求行為,標頭、狀態編碼和參數在這裡也應用於所有端點。
- 查詢參數:
format – 響應格式(覆蓋了 Accept)。可能的值相依於 REST 框架設定,預設支援
json
和api
。後者為 API 提供了 web 瀏覽器接口。page – Returns given page of paginated results (use next and previous fields in response to automate the navigation).
page_size – Return the given number of items per request. The default is 50 and the maximum is 1000. For the units endpoints the default is 100 with a maximum of 10000. The default value is also configurable using the PAGE_SIZE setting.
- 請求標頭:
Authorization – optional token to authenticate as
Authorization: Token YOUR-TOKEN
- 響應標頭:
Content-Type – 這相依於請求的標頭 Accept
Allow – 對象允許的 HTTP 方法的列表
- Response JSON Object:
detail (string) – 結果的詳細描述(對於 200 OK 以外的 HTTP 狀態編碼)
count (int) – 對象列表的總項目計數
next (string) – 對象列表的下一頁 URL
previous (string) – 對象列表的上一頁 URL
results (array) – 對象列表的結果
url (string) – 使用 API 存取這個資源的 URL
web_url (string) – 使用瀏覽器存取這個資源的 URL
- 狀態編碼:
200 OK – 當請求被正確地處理時
201 Created – 當成功建立新對象時
204 No Content – 當一個對象成功刪除時
400 Bad Request – 當缺少表格參數時
403 Forbidden – 當存取被拒絕時
429 Too Many Requests – 當出現瓶頸時
Authentication tokens¶
在 4.10 版的變更: Project scoped tokens were introduced in the 4.10 release.
Each user has a personal access token which can be obtained in the user
profile. Newly generated user tokens have the wlu_
prefix.
It is possible to create project scoped tokens for API access to given project
only. These tokens can be identified by the wlp_
prefix.
身份驗證的例子¶
示例請求:
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/
Passing Parameters Examples¶
對於 POST 方法,參數可以指定為表格送交(application/x-www-form-urlencoded)或 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 示例:
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/
Components and categories¶
To access a component which is nested inside a 類別, you need to URL
encode the category name into a component name separated with a slash. For
example usage
placed in a docs
category needs to be used as
docs%252Fusage
. Full URL in this case would be for example
https://example.com/api/components/hello/docs%252Fusage/repository/
.
API 頻次限制¶
這個 API 請求限制了速率;對於匿名使用者預設組態限制為每天 100 個請求,對於身份驗證的使用者限制為每小時 5000 個請求。
速率限制可以在:file:settings.py 中調整;如何組態它的更多細節請參見`Throttling in Django REST framework documentation <https://www.django-rest-framework.org/api-guide/ throttling/>`_。
In the Docker container this can be configured using
WEBLATE_API_RATELIMIT_ANON
and WEBLATE_API_RATELIMIT_USER
.
速率限制在後面的標頭中報告:
|
要執行的對速率限制進行限制的請求 |
|
保持限制的請求 |
|
直到速率限制窗口重置時的秒數 |
在 4.1 版的變更: 新增速率限制狀態的標頭。
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/" }
使用者¶
在 4.0 版被加入.
- GET /api/users/¶
返回使用者列表,如果有權限查看管理使用者的話。如果沒有,那麼會只看到自己的具體資訊。
也參考
使用者對象屬性被歸檔在
GET /api/users/(str:username)/
。
- POST /api/users/¶
建立新使用者。
- 參數值:
username (string) – 使用者名稱
full_name (string) – User full name
email (string) – 使用者電子郵箱
is_superuser (boolean) – 使用者是超級使用者嗎? (可選的)
is_active (boolean) – 使用者是活動使用者嗎? (可選的)
is_bot (boolean) – Is user bot? (optional) (used for project scoped tokens)
- GET /api/users/(str: username)/¶
返回使用者的資訊。
- 參數值:
username (string) – 使用者的使用者名
- Response JSON Object:
username (string) – 使用者的使用者名
full_name (string) – 使用者的全名
email (string) – 使用者的電子郵箱
is_superuser (boolean) – 使用者是否是超級使用者
is_active (boolean) – 使用者是否是活動使用者
is_bot (boolean) – whether the user is bot (used for project scoped tokens)
date_joined (string) – 建立使用者的日期
last_login (string) – date the user last signed in
groups (array) – 連接到關聯的組;請參見
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, "is_bot": false, "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)/¶
更改使用者參數。
- 參數值:
username (string) – 使用者的使用者名
- Response JSON Object:
username (string) – 使用者的使用者名
full_name (string) – 使用者的全名
email (string) – 使用者的電子郵箱
is_superuser (boolean) – 使用者是否是超級使用者
is_active (boolean) – 使用者是否是活動使用者
is_bot (boolean) – whether the user is bot (used for project scoped tokens)
date_joined (string) – 建立使用者的日期
- PATCH /api/users/(str: username)/¶
更改使用者參數。
- 參數值:
username (string) – 使用者的使用者名
- Response JSON Object:
username (string) – 使用者的使用者名
full_name (string) – 使用者的全名
email (string) – 使用者的電子郵箱
is_superuser (boolean) – 使用者是否是超級使用者
is_active (boolean) – 使用者是否是活動使用者
is_bot (boolean) – whether the user is bot (used for project scoped tokens)
date_joined (string) – 建立使用者的日期
- DELETE /api/users/(str: username)/¶
刪除所有的使用者資訊並將使用者標記為不活動使用者。
- 參數值:
username (string) – 使用者的使用者名
- POST /api/users/(str: username)/groups/¶
將群組與使用者關聯。
- 參數值:
username (string) – 使用者的使用者名
- 表格參數:
string group_id – 唯一的群組 ID
- DELETE /api/users/(str: username)/groups/¶
在 4.13.1 版被加入.
Remove user from a group.
- 參數值:
username (string) – 使用者的使用者名
- 表格參數:
string group_id – 唯一的群組 ID
- GET /api/users/(str: username)/statistics/¶
使用者的統計資料列表。
- 參數值:
username (string) – 使用者的使用者名
- Response JSON Object:
translated (int) – Number of translations by user
suggested (int) – Number of suggestions by user
uploaded (int) – Number of uploads by user
commented (int) – Number of comments by user
languages (int) – Number of languages user can translate
- GET /api/users/(str: username)/notifications/¶
使用者的訂閱列表。
- 參數值:
username (string) – 使用者的使用者名
- POST /api/users/(str: username)/notifications/¶
將訂閱與使用者關聯。
- 參數值:
username (string) – 使用者的使用者名
- Request JSON Object:
notification (string) – 註冊通知的名稱
scope (int) – 來自可用選擇的通知範圍
frequency (int) – 通知的頻率選擇
- GET /api/users/(str: username)/notifications/(int: subscription_id)/¶
獲得與使用者關聯的訂閱。
- 參數值:
username (string) – 使用者的使用者名
subscription_id (int) – ID of notification registered
- PUT /api/users/(str: username)/notifications/(int: subscription_id)/¶
編輯與使用者關聯的訂閱。
- 參數值:
username (string) – 使用者的使用者名
subscription_id (int) – ID of notification registered
- Request JSON Object:
notification (string) – 註冊通知的名稱
scope (int) – 來自可用選擇的通知範圍
frequency (int) – 通知的頻率選擇
- PATCH /api/users/(str: username)/notifications/(int: subscription_id)/¶
編輯與使用者關聯的訂閱。
- 參數值:
username (string) – 使用者的使用者名
subscription_id (int) – ID of notification registered
- Request JSON Object:
notification (string) – 註冊通知的名稱
scope (int) – 來自可用選擇的通知範圍
frequency (int) – 通知的頻率選擇
- DELETE /api/users/(str: username)/notifications/(int: subscription_id)/¶
刪除與使用者關聯的訂閱。
- 參數值:
username (string) – 使用者的使用者名
subscription_id – 註冊通知的名稱
subscription_id – int
群組¶
在 4.0 版被加入.
- GET /api/groups/¶
返回群組列表,如果有權限看到管理群組的話,如果沒有,那麼會只看到使用者所在的群組。
也參考
群組對象屬性歸檔在
GET /api/groups/(int:id)/
。
- POST /api/groups/¶
建立新的群組。
- 參數值:
name (string) – 群組名稱
project_selection (int) – 給定選項的專案選取的群組
language_selection (int) – 給定選項的語言選擇的群組
defining_project (str) – link to the defining project, used for 管理單一專案的存取控制; see
GET /api/projects/(string:project)/
- GET /api/groups/(int: id)/¶
返回群組的資訊。
- 參數值:
id (int) – 群組的 ID
- Response JSON Object:
name (string) – 群組的名稱
project_selection (int) – 相應於對象群組的整數
language_selection (int) – 相應於語言群組的整數
roles (array) – 相關聯角色的連接;請參見
GET /api/roles/(int:id)/
projects (array) – 相關聯項目的連接;請參見
GET /api/projects/(string:project)/
components (array) – 相關聯組件的連接;請參見
GET /api/components/(string:project)/(string:component)/
componentlists (array) – 相關聯組件列表的連接;請參見
GET /api/component-lists/(str:slug)/
defining_project (str) – link to the defining project, used for 管理單一專案的存取控制; see
GET /api/projects/(string:project)/
Example JSON data:
{ "name": "Guests", "defining_project": null, "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)/¶
更改群組參數。
- 參數值:
id (int) – 群組的 ID
- Response JSON Object:
name (string) – 群組的名稱
project_selection (int) – 相應於對象群組的整數
language_selection (int) – 相應於語言群組的整數
- PATCH /api/groups/(int: id)/¶
更改群組參數。
- 參數值:
id (int) – 群組的 ID
- Response JSON Object:
name (string) – 群組的名稱
project_selection (int) – 相應於對象群組的整數
language_selection (int) – 相應於語言群組的整數
- DELETE /api/groups/(int: id)/¶
Deletes the group.
- 參數值:
id (int) – 群組的 ID
- POST /api/groups/(int: id)/roles/¶
將角色與群組關聯。
- 參數值:
id (int) – 群組的 ID
- 表格參數:
string role_id – 唯一的角色 ID
- POST /api/groups/(int: id)/components/¶
將組件與群組關聯。
- 參數值:
id (int) – 群組的 ID
- 表格參數:
string component_id – 唯一的組件 ID
- DELETE /api/groups/(int: id)/components/(int: component_id)¶
從群組刪除組件。
- 參數值:
id (int) – 群組的 ID
component_id (int) – 唯一的組件 ID
- POST /api/groups/(int: id)/projects/¶
將項目與群組關聯。
- 參數值:
id (int) – 群組的 ID
- 表格參數:
string project_id – 唯一的項目 ID
- DELETE /api/groups/(int: id)/projects/(int: project_id)¶
從群組刪除項目。
- 參數值:
id (int) – 群組的 ID
project_id (int) – 唯一的項目 ID
- POST /api/groups/(int: id)/languages/¶
將語言與群組關聯。
- 參數值:
id (int) – 群組的 ID
- 表格參數:
string language_code – 唯一的語言代碼
- DELETE /api/groups/(int: id)/languages/(string: language_code)¶
從群組刪除語言。
- 參數值:
id (int) – 群組的 ID
language_code (string) – 唯一的語言代碼
- POST /api/groups/(int: id)/componentlists/¶
將組件列表與群組關聯。
- 參數值:
id (int) – 群組的 ID
- 表格參數:
string component_list_id – 唯一的組件列表 ID
- DELETE /api/groups/(int: id)/componentlists/(int: component_list_id)¶
從群組刪除組件列表。
- 參數值:
id (int) – 群組的 ID
component_list_id (int) – 唯一的組件列表 ID
- POST /api/groups/(int: id)/admins/¶
在 5.5 版被加入.
Add user to team admins.
- 參數值:
id (int) – 群組的 ID
- 表格參數:
string user_id – The user’s ID
- DELETE /api/groups/(int: id)/admins/(int: user_id)¶
在 5.5 版被加入.
Delete user from team admins.
- 參數值:
id (int) – 群組的 ID
user_id (integer) – The user’s ID
角色¶
- GET /api/roles/¶
返回與使用者關聯的所有角色列表。如果使用者是超級使用者,那麼返回所有現有角色的列表。
也參考
角色對象屬性歸檔在
GET /api/roles/(int:id)/
。
- POST /api/roles/¶
建立新角色。
- 參數值:
name (string) – 角色名稱
permissions (array) – 權限編碼名稱的列表
- GET /api/roles/(int: id)/¶
返回角色的資訊。
- 參數值:
id (int) – 角色 ID
- Response JSON Object:
name (string) – 角色名稱
permissions (array) – 權限編碼名稱的列表
Example JSON data:
{ "name": "Access repository", "permissions": [ "vcs.access", "vcs.view" ], "url": "http://example.com/api/roles/1/", }
- PUT /api/roles/(int: id)/¶
更改角色參數。
- 參數值:
id (int) – 角色的ID
- Response JSON Object:
name (string) – 角色名稱
permissions (array) – 權限編碼名稱的列表
- PATCH /api/roles/(int: id)/¶
更改角色參數。
- 參數值:
id (int) – 角色的ID
- Response JSON Object:
name (string) – 角色名稱
permissions (array) – 權限編碼名稱的列表
- DELETE /api/roles/(int: id)/¶
Deletes the role.
- 參數值:
id (int) – 角色的ID
語言¶
- GET /api/languages/¶
返回所有語言的列表。
也參考
語言對象屬性存檔在
GET /api/languages/(string:language)/
。
- POST /api/languages/¶
建立新的語言。
- 參數值:
code (string) – 語言名稱
name (string) – 語言名稱
direction (string) – 文字方向
population (int) – 語言使用者數量
plural (object) – 語言複數形式與數字
- GET /api/languages/(string: language)/¶
返回語言的資訊。
- 參數值:
language (string) – 語言碼
- Response JSON Object:
code (string) – 語言碼
direction (string) – 文字方向
plural (object) – 語言複數資訊的對象
aliases (array) – 語言別名的數組
- Request JSON Object:
population (int) – 語言使用者數量
Example JSON data:
{ "code": "en", "direction": "ltr", "name": "English", "population": 159034349015, "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)/¶
更改語言參數。
- 參數值:
language (string) – 語言的編碼
- Request JSON Object:
name (string) – 語言名稱
direction (string) – 文字方向
population (int) – 語言使用者數量
plural (object) – Language plural details
- PATCH /api/languages/(string: language)/¶
更改語言參數。
- 參數值:
language (string) – 語言的編碼
- Request JSON Object:
name (string) – 語言名稱
direction (string) – 文字方向
population (int) – 語言使用者數量
plural (object) – Language plural details
- DELETE /api/languages/(string: language)/¶
Deletes the language.
- 參數值:
language (string) – 語言的編碼
專案¶
- GET /api/projects/¶
返回所有項目的列表。
也參考
項目對象的屬性存檔在
GET /api/projects/(string:project)/
。
- POST /api/projects/¶
建立新項目。
- 參數值:
name (string) – 專案名稱
slug (string) – 項目標識串
web (string) – 專案網站
- GET /api/projects/(string: project)/¶
返回項目的資訊。
- 參數值:
project (string) – 專案 URL slug
- Response JSON Object:
name (string) – 專案名稱
slug (string) – 項目標識串
web (string) – 項目網站
components_list_url (string) – 組件列表的 URL;請參見
GET /api/projects/(string:project)/components/
repository_url (string) – 儲存庫狀態的 URL;請參見
GET /api/projects/(string:project)/repository/
changes_list_url (string) – 更改列表的 URL;請參見
GET /api/projects/(string:project)/repository/
credits_url (string) – URL to list contributor credits; see
GET /api/projects/(string:project)/credits/
translation_review (boolean) – 啟用檢閱
source_review (boolean) – 啟用來源檢閱
set_language_team (boolean) – 設定「Language-Team」檔案標頭
enable_hooks (boolean) – 啟用掛勾
instructions (string) – 翻譯指示
language_aliases (string) – 語言別名
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 版被加入.
透過 PATCH 請求來編輯一個專案。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- PUT /api/projects/(string: project)/¶
在 4.3 版被加入.
透過 PUT 請求來編輯一個專案。
- 參數值:
project (string) – 專案 URL slug
- DELETE /api/projects/(string: project)/¶
Deletes a project.
- 參數值:
project (string) – 專案 URL slug
- GET /api/projects/(string: project)/changes/¶
返回項目更改的列表。這本質上是仔細檢查的項目
GET /api/changes/
接收相同的參數。- 參數值:
project (string) – 專案 URL slug
- Response JSON Object:
results (array) – 組件對象的矩陣;請參見
GET /api/changes/(int:id)/
- GET /api/projects/(string: project)/file/¶
在 5.5 版被加入.
Downloads all available translations associated with the project as an archive file using the requested format and language.
- 參數值:
project (string) – 專案 URL slug
- 查詢參數:
format (string) – The archive format to use; If not specified, defaults to
zip
; Supported formats:zip
andzip:CONVERSION
whereCONVERSION
is one of converters listed at 下載翻譯.language_code (string) – The language code to download; If not specified, all languages are included.
- GET /api/projects/(string: project)/repository/¶
回傳版本控制系統(VCS)儲存庫狀態的資訊。這個端點只包含專案所有儲存庫的整體概況。為了得到更多細節,請使用
GET /api/components/(string:project)/(string:component)/repository/
。- 參數值:
project (string) – 專案 URL slug
- Response JSON Object:
needs_commit (boolean) – 是否有待定的更改要送交
needs_merge (boolean) – 是否有上游更改要合併
needs_push (boolean) – 是否有本地更改要推送
Example JSON data:
{ "needs_commit": true, "needs_merge": false, "needs_push": true }
- POST /api/projects/(string: project)/repository/¶
在版本控制系統(VCS)儲存庫上執行給定的操作。
- 參數值:
project (string) – 專案 URL slug
- Request JSON Object:
operation (string) – Operation to perform: one of
push
,pull
,commit
,reset
,cleanup
,file-sync
,file-scan
- Response JSON Object:
result (boolean) – 操作的結果
CURL 示例:
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/¶
返回給定項目的翻譯組件列表。
- 參數值:
project (string) – 專案 URL slug
- Response JSON Object:
results (array) – 組件對象的矩陣;請參見
GET /api/components/(string:project)/(string:component)/
- POST /api/projects/(string: project)/components/¶
在 4.3 版的變更:
zipfile
和docfile
參數現在可被無 VCS 的元件所接受,見 Local files.在 4.6 版的變更: 克隆的儲存庫現在使用 內部網址,現在自動在專案中自動共享。使用
isable_autoshare
關閉。在給定的項目中新建翻譯組件。
提示
從單個 VCS 儲存庫中建立多個元件時,使用 內部網址。
備註
多數元件的新建發生在後台。檢查新建元件的
task_url
屬性,並按照那裡的步驟進行。- 參數值:
project (string) – 專案 URL slug
- 表格參數:
file zipfile – 上傳到 Weblate 用於翻譯初始化的 ZIP 文件
file docfile – 要翻譯的文件
boolean disable_autoshare – 停用自動儲存庫共享 內部網址。
- Request JSON Object:
object – Component parameters, see
GET /api/components/(string:project)/(string:component)/
- Response JSON Object:
result (object) – 新建組件對象;請參見
GET /api/components/(string:project)/(string:component)/
使用“ZipFile``和````````````````````````)無法使用JSON。資料必須上傳為:MimeType:multipart / form-data。
CURL form request example:
curl \ --form docfile=@strings.html \ --form name=Weblate \ --form slug=weblate \ --form file_format=html \ --form new_lang=add \ -H "Authorization: Token TOKEN" \ http://example.com/api/projects/hello/components/
CURL JSON request example:
curl \ --data-binary '{ "branch": "main", "file_format": "po", "filemask": "po/*.po", "name": "Weblate", "slug": "weblate", "repo": "https://github.com/WeblateOrg/hello.git", "template": "", "new_base": "po/hello.pot", "vcs": "git" }' \ -H "Content-Type: application/json" \ -H "Authorization: Token TOKEN" \ http://example.com/api/projects/hello/components/
JSON request to create a new component from Git:
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": "main", "file_format": "po", "filemask": "po/*.po", "name": "Weblate", "slug": "weblate", "repo": "https://github.com/WeblateOrg/hello.git", "template": "", "new_base": "po/hello.pot", "vcs": "git" }
JSON request to create a new component from another one:
POST /api/projects/hello/components/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 { "file_format": "po", "filemask": "po/*.po", "name": "Weblate", "slug": "weblate", "repo": "weblate://weblate/hello", "template": "", "new_base": "po/hello.pot", "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": "main", "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", "population": 159034349015, "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/¶
對項目內的所有語言返回編頁的統計資料。
- 參數值:
project (string) – 專案 URL slug
- Response JSON Object:
results (array) – 翻譯統計資料對象的矩陣
language (string) – 語言名稱
code (string) – 語言代碼
total (int) – 字串的總數
translated (int) – 已翻譯的字串數量
translated_percent (float) – 已翻譯字串的百分比
total_words (int) – 詞的總數
translated_words (int) – 已翻譯詞的數量
words_percent (float) – 已翻譯詞的百分比
- GET /api/projects/(string: project)/statistics/¶
返回項目的統計資料。
- 參數值:
project (string) – 專案 URL slug
也參考
Returned attributes are described in 統計數據.
- GET /api/projects/(string: project)/categories/¶
在 5.0 版被加入: Returns categories for a project. See
GET /api/categories/(int:id)/
for field definitions.- param project:
專案 URL slug
- type project:
字串
- GET /api/projects/(string: project)/labels/¶
在 5.3 版被加入: Returns labels for a project.
- param project:
專案 URL slug
- type project:
字串
- >json int id:
ID of the label
- >json string name:
name of the label
- >json string color:
color of the label
- POST /api/projects/(string: project)/labels/¶
在 5.3 版被加入: Creates a label for a project.
- param project:
專案 URL slug
- type project:
字串
- <json string name:
name of the label
- <json string color:
color of the label
- GET /api/projects/(string: project)/credits/¶
Returns contributor credits for a project.
在 5.7 版被加入.
- 參數值:
project (string) – 專案 URL slug
start (date) – Lower-bound ISO 8601 timestamp (mandatory)
end (date) – Upper-bound ISO 8601 timestamp (mandatory)
lang (source_language) – Language code to search for
- Response JSON Object:
email (string) – Email of the contributor
full_name (string) – Full name of the contributor
change_count (string) – Number of changes done in the time range
組件¶
提示
Use POST /api/projects/(string:project)/components/
to create new components.
- GET /api/components/¶
返回翻譯組件的列表。
也參考
組件對象屬性存檔在
GET /api/components/(string:project)/(string:component)/
。
- GET /api/components/(string: project)/(string: component)/¶
返回翻譯組件的資訊。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
project (object) – 翻譯項目;請參見
GET /api/projects/(string:project)/
name (string) – 組件名稱
slug (string) – 組件標識串
vcs (string) – 版本控制系統
linked_component (string) – component whose repository is linked via Weblate 內部網址
repo (string) – 來源碼儲存庫, this is the actual repository URL even when Weblate 內部網址 are used, use
linked_component
to detect this situationgit_export (string) – 已匯出儲存庫 URL
branch (string) – 儲存庫分支, this is the actual repository branch even when Weblate 內部網址 are used
push (string) – 儲存庫推送 URL, this is the actual repository URL even when Weblate 內部網址 are used
push_branch (string) – 推送分支, this is the actual repository branch even when Weblate 內部網址 are used
filemask (string) – 檔案遮罩
template (string) – 單語的基底語言檔
edit_template (string) – 編輯基底檔
intermediate (string) – 中間語言檔案
new_base (string) – 新翻譯的模板
file_format (string) – 檔案格式
license (string) – 翻譯授權條款
agreement (string) – 貢獻者協議書
new_lang (string) – 加入新翻譯
language_code_style (string) – 語言代碼類型
source_language (object) – 源語言對象;請參見
GET /api/languages/(string:language)/
check_flags (string) – 翻譯旗標
priority (string) – 優先度
enforced_checks (string) – 強制查核
restricted (string) – 受限制的存取
repoweb (string) – 儲存庫瀏覽器
report_source_bugs (string) – 來源字串臭蟲回報位址
merge_style (string) – 合併類型
commit_message (string) – Commit, add, delete, merge, add-on, and merge request messages
add_message (string) – Commit, add, delete, merge, add-on, and merge request messages
delete_message (string) – Commit, add, delete, merge, add-on, and merge request messages
merge_message (string) – Commit, add, delete, merge, add-on, and merge request messages
addon_message (string) – Commit, add, delete, merge, add-on, and merge request messages
pull_message (string) – Commit, add, delete, merge, add-on, and merge request messages
allow_translation_propagation (string) – 允許翻譯再用
enable_suggestions (string) – 啟用建議
suggestion_voting (string) – 建議投票
suggestion_autoaccept (string) – 自動接受建議
push_on_commit (string) – 送交時一併推送
commit_pending_age (string) – 更動後送交的經過時間
auto_lock_error (string) – 有錯誤時鎖定
language_regex (string) – 語言篩選
variant_regex (string) – 變體的正則表達式
is_glossary (bool) – 當作詞彙表
glossary_color (string) – 詞彙表色彩
repository_url (string) – 儲存庫狀態的 URL;請參見
GET /api/components/(string:project)/(string:component)/repository/
translations_url (string) – 翻譯列表的 URL;請參見
GET /api/components/(string:project)/(string:component)/translations/
lock_url (string) – 鎖定狀態的 URL;請參見
GET /api/components/(string:project)/(string:component)/lock/
changes_list_url (string) – 更改的列表的 URL;請參見
GET /api/components/(string:project)/(string:component)/changes/
task_url (string) – 後台任務 URL (如果有的話);請參見
GET /api/tasks/(str:uuid)/
credits_url (string) – URL to to list contributor credits; see
GET /api/components/(string:project)/(string:component)/credits/
Example JSON data:
{ "branch": "main", "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", "population": 159034349015, "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", "population": 159034349015, "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)/¶
透過 PATCH 請求來編輯一個元件。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
source_language (string) – 項目源語言代碼(可選)
- Request JSON Object:
name (string) – name of component
slug (string) – slug of component
repo (string) – VCS repository URL
CURL 示例:
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": "main", "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", "population": 159034349015, "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)/¶
透過 PUT 請求來編輯一個元件。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Request JSON Object:
branch (string) – VCS repository branch
file_format (string) – 翻譯的文件格式
filemask (string) – 儲存庫中翻譯檔的遮罩
name (string) – name of component
slug (string) – slug of component
repo (string) – VCS repository URL
template (string) – 但語言翻譯的譯文模板文件
new_base (string) – 用於新增新翻譯的譯文模板文件
vcs (string) – version control system
- DELETE /api/components/(string: project)/(string: component)/¶
Deletes a component.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- GET /api/components/(string: project)/(string: component)/changes/¶
返回組件更改的列表。這本質上是仔細檢查的組件 :http:get:`/api/changes/`接相同參數。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
results (array) – 組件對象的矩陣;請參見
GET /api/changes/(int:id)/
- GET /api/components/(string: project)/(string: component)/file/¶
在 4.9 版被加入.
Downloads all available translations associated with the component as an archive file using the requested format.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- 查詢參數:
format (string) – The archive format to use; If not specified, defaults to
zip
; Supported formats:zip
andzip:CONVERSION
whereCONVERSION
is one of converters listed at 下載翻譯.
- GET /api/components/(string: project)/(string: component)/screenshots/¶
返回組件螢幕截圖的列表。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
results (array) – 組件螢幕截圖的矩陣;請參見
GET /api/screenshots/(int:id)/
- GET /api/components/(string: project)/(string: component)/lock/¶
返回組件鎖定狀態。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
locked (boolean) – 組件是否因更新而鎖定
Example JSON data:
{ "locked": false }
- POST /api/components/(string: project)/(string: component)/lock/¶
設定組件鎖定狀態。
響應時間與 :http:get:`/api/components/(string:project)/(string:component)/lock/`相同。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Request JSON Object:
lock – 是否鎖定的布爾值。
CURL 示例:
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/¶
回傳版本控制系統(VCS)儲存庫狀態的資訊。
響應與
GET /api/projects/(string:project)/repository/
的相同。- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
needs_commit (boolean) – 是否有待定的更改要送交
needs_merge (boolean) – 是否有上游更改要合併
needs_push (boolean) – 是否有本地更改要推送
remote_commit (string) – Remote commit information
status (string) – 由版本控制系統(VCS)報告的 VCS 狀態
merge_failure – 描述合併失敗的文本,沒有的話為空
- POST /api/components/(string: project)/(string: component)/repository/¶
在版本控制系統(VCS)儲存庫執行給定的操作。
文件請參見
POST /api/projects/(string:project)/repository/
。- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Request JSON Object:
operation (string) – 執行的操作:
push
,pull
,commit
,reset
, ``cleanup``之一
- Response JSON Object:
result (boolean) – 操作的結果
CURL 示例:
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/¶
為單語言翻譯下載譯文模板文件。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- GET /api/components/(string: project)/(string: component)/new_template/¶
為新的翻譯下載模板文件。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- GET /api/components/(string: project)/(string: component)/translations/¶
返回給定組件中翻譯對象的列表。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
results (array) – 翻譯對象的矩陣;請參見
GET /api/translations/(string:project)/(string:component)/(string:language)/
- POST /api/components/(string: project)/(string: component)/translations/¶
在給定組件中新建新的翻譯。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Request JSON Object:
language_code (string) – 翻譯語言代碼;請參見
GET /api/languages/(string:language)/
- Response JSON Object:
result (object) – 新建的新翻譯對象
CURL 示例:
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", "population": 1303174280 "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/¶
對組件內所有的翻譯返回分頁的統計資料。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
也參考
Returned attributes are described in 統計數據.
- GET /api/components/(string: project)/(string: component)/links/¶
Returns projects linked with a component.
在 4.5 版被加入.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- Response JSON Object:
projects (array) – associated projects; see
GET /api/projects/(string:project)/
- POST /api/components/(string: project)/(string: component)/links/¶
Associate project with a component.
在 4.5 版被加入.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
- 表格參數:
string project_slug – 項目標識串
- DELETE /api/components/(string: project)/(string: component)/links/(string: project_slug)/¶
Remove association of a project with a component.
在 4.5 版被加入.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
project_slug (string) – Slug of the project to remove
- GET /api/components/(string: project)/(string: component)/credits/¶
Returns contributor credits for a project.
在 5.7 版被加入.
- 參數值:
project (string) – 專案 URL slug
start (date) – Lower-bound ISO 8601 timestamp (mandatory)
end (date) – Upper-bound ISO 8601 timestamp (mandatory)
lang (source_language) – Language code to search for
- Response JSON Object:
email (string) – Email of the contributor
full_name (string) – Full name of the contributor
change_count (string) – Number of changes done in the time range
翻譯¶
- GET /api/translations/¶
返回翻譯的列表。
- GET /api/translations/(string: project)/(string: component)/(string: language)/¶
返回翻譯的資訊。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- Response JSON Object:
component (object) – 組件對象;請參見
GET /api/components/(string:project)/(string:component)/
failing_checks (int) – number of strings failing checks
failing_checks_percent (float) – percentage of strings failing checks
failing_checks_words (int) – number of words with failing checks
filename (string) – 翻譯文件名
fuzzy (int) – number of fuzzy (marked for edit) strings
fuzzy_percent (float) – 模糊字串 (標記為需要編輯)的百分比
fuzzy_words (int) – 模糊 (標記為編輯))字串中的單詞數
have_comment (int) – 帶有註釋的字串數量
have_suggestion (int) – 帶有建議的字串數量
is_template (boolean) – whether the translation has a monolingual base
language (object) – 源語言對象;請參見
GET /api/languages/(string:language)/
language_code (string) – 儲存庫中使用的語言代碼;這可以不同於語言物件中的語言代碼
last_author (string) – 最後一位作者的姓名
last_change (timestamp) – last change timestamp
revision (string) – 文件的修訂哈希值
share_url (string) – 用於分享導向約定頁面的 URL
total (int) – 字串的總數
total_words (int) – 詞的總數
translate_url (string) – URL for translating
translated (int) – 已翻譯的字串數量
translated_percent (float) – 已翻譯字串的百分比
translated_words (int) – 已翻譯詞的數量
repository_url (string) – 儲存庫狀態的 URL;請參見
GET /api/translations/(string:project)/(string:component)/(string:language)/repository/
file_url (string) – 文件對象的 URL;請參見
GET /api/translations/(string:project)/(string:component)/(string:language)/file/
changes_list_url (string) – 更改的列表的 URL;請參見
GET /api/translations/(string:project)/(string:component)/(string:language)/changes/
units_list_url (string) – 字串列表的 URL;請參見
GET /api/translations/(string:project)/(string:component)/(string:language)/units/
Example JSON data:
{ "component": { "branch": "main", "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", "population": 159034349015, "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", "population": 1303174280 "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)/¶
Deletes a translation.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- GET /api/translations/(string: project)/(string: component)/(string: language)/changes/¶
返回翻譯更改的列表。這本質上是仔細檢查的翻譯 :http:get:`/api/changes/`接受相同參數。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- Response JSON Object:
results (array) – 組件對象的矩陣;請參見
GET /api/changes/(int:id)/
- GET /api/translations/(string: project)/(string: component)/(string: language)/units/¶
返回翻譯單元的列表。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
q (string) – 搜尋查詢字串 :ref:`Searching`(選用)
- Response JSON Object:
results (array) – 組件對象的矩陣;請參見
GET /api/units/(int:id)/
- POST /api/translations/(string: project)/(string: component)/(string: language)/units/¶
Add new unit.
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- Request JSON Object:
key (string) – Monolingual translations: Key of translation unit
value (array) – Monolingual translations: Source strings (use single string if not creating plural)
context (string) – Bilingual translations: Context of a translation unit
source (array) – Bilingual translations: Source strings (use single string if not creating plural)
target (array) – Bilingual translations: Target strings (use single string if not creating plural)
state (int) – String state; see
GET /api/units/(int:id)/
- Response JSON Object:
unit (object) – newly created unit; see
GET /api/units/(int:id)/
- POST /api/translations/(string: project)/(string: component)/(string: language)/autotranslate/¶
觸發自動翻譯。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- Request JSON Object:
mode (string) – 自動翻譯模式
filter_type (string) – 自動翻譯篩選類型
auto_source (string) – Automatic translation source -
mt
orothers
component (string) – 開啟對專案的共享翻譯記憶作貢獻,以取得其他組件的存取權。
engines (array) – 機器翻譯引擎
threshold (string) – 分數閾值
- GET /api/translations/(string: project)/(string: component)/(string: language)/file/¶
下載儲存在 VCS 中的目前翻譯文件(不帶 ``format``參數)或將其轉換為另一格式(見 下載翻譯)。
備註
這個 API 端點使用了不同於API其餘的邏輯來輸出,它在整個文件而不是在資料上操作。接受的``format``參數組不同,沒有這個參數會將翻譯文件儲存在版本控制系統(VCS)中。
- 響應標頭:
Last-Modified – Timestamp of last change to this file.
- 請求標頭:
If-Modified-Since – Skips response if the file has not been modified since that time.
- 查詢參數:
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- POST /api/translations/(string: project)/(string: component)/(string: language)/file/¶
上傳帶有翻譯的新文件。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- 表格參數:
string conflicts – How to deal with conflicts (
ignore
,replace-translated
orreplace-approved
), see 衝突處理file file – 上傳文件
string email – 作者郵件信箱
string author – 作者姓名
string method – 上傳方法(
translate
,approve
,suggest
,fuzzy
,replace
,source
,add
),見:ref: upload-methodstring fuzzy – 模糊 (標記為需要編輯)的字串處理(empty,
process
,approve
)
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/¶
回傳版本控制系統(VCS)儲存庫狀態的資訊。
響應與 :http:get:`/api/components/(string:project)/(string:component)/repository/`的相同。
- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- POST /api/translations/(string: project)/(string: component)/(string: language)/repository/¶
在版本控制系統(VCS)儲存庫上執行給定的操作。
文件請參見
POST /api/projects/(string:project)/repository/
。- 參數值:
project (string) – 專案 URL slug
component (string) – 組件 URL slug
language (string) – Translation language code
- Request JSON Object:
operation (string) – 執行的操作:
push
,pull
,commit
,reset
, ``cleanup``之一
- Response JSON Object:
result (boolean) – 操作的結果
記憶¶
在 4.14 版被加入.
- GET /api/memory/¶
Returns a list of memory results.
- DELETE /api/memory/(int: memory_object_id)/¶
Deletes a memory object
- 參數值:
memory_object_id – Memory Object ID
單位¶
“單位”是一個翻譯的單曲,它對具有相應翻譯的字串對的來源字串,也包含一些相關元資料。該術語來自“翻譯工具包”<http://docs.translatehouse.org/projects/translate-toolkit/en/latest/api/storage.html#translate.storage.base.translationUnit>`_和xliff。
- GET /api/units/¶
返回翻譯單元的列表。
- 參數值:
q (string) – 搜尋查詢字串 :ref:`Searching`(選用)
也參考
單元對象屬性存檔在
GET /api/units/(int:id)/
。
- GET /api/units/(int: id)/¶
在 4.3 版的變更:
target
和source
現在是矩陣,來適當的處理多個字串。返回翻譯單元的資訊。
- 參數值:
id (int) – 單元 ID
- Response JSON Object:
translation (string) – 相關翻譯對象的 URL
source (array) – 來源字串
previous_source (string) – 用於模糊匹配的之前的源字串
target (array) – 目標字串
id_hash (string) – 單元的唯一識別文字
content_hash (string) – 源字串的唯一識別文字
location (string) – 來源碼中單元的位置
context (string) – 翻譯單元的語境
note (string) – 翻譯單元的註解
flags (string) – 翻譯單元的標記
labels (array) – translation unit labels, available on source units
state (int) – unit state, 0 - untranslated, 10 - needs editing, 20 - translated, 30 - approved, 100 - read only
fuzzy (boolean) – 是否為 fuzzy 或標記為需檢閱
translated (boolean) – whether the unit is translated
approved (boolean) – whether the translation is approved
position (int) – 翻譯文件中的單元位置
has_suggestion (boolean) – whether the unit has suggestions
has_comment (boolean) – whether the unit has comments
has_failing_check (boolean) – whether the unit has failing checks
num_words (int) – 源詞彙的數量
priority (int) – 翻譯優先級;100為預設值
id (int) – 單元識別問題
explanation (string) – 字串的解釋,可在源單元獲得,請參見 源字串另外的資訊
extra_flags (string) – 另外的字串標記,可在源單元獲得,請參見 使用標誌自定義行為
web_url (string) – 單元可以被編輯的 URL
source_unit (string) – 源單元連結;請參見
GET /api/units/(int:id)/
pending (boolean) – 是否為等候寫入
timestamp (timestamp) – string age
last_updated (timestamp) – last string update
- PATCH /api/units/(int: id)/¶
在 4.3 版被加入.
對翻譯單元執行部分更新。
- 參數值:
id (int) – 單元 ID
- Request JSON Object:
- PUT /api/units/(int: id)/¶
在 4.3 版被加入.
對翻譯單元執行完整更新。
- 參數值:
id (int) – 單元 ID
- Request JSON Object:
- DELETE /api/units/(int: id)/¶
在 4.3 版被加入.
刪除一個翻譯單元。
- 參數值:
id (int) – 單元 ID
更動¶
- GET /api/changes/¶
在 4.1 版的變更: 更改的篩選在 4.1 版本引入。
返回翻譯更改的列表。
也參考
更改對象的屬性存檔在
GET /api/changes/(int:id)/
。- 查詢參數:
user (string) – 篩選使用者的使用者名稱
action (int) – 篩選的動作,可以多次使用
timestamp_after (timestamp) – ISO 8601 格式的時間標籤,列出此時間之後的更改
timestamp_before (timestamp) – ISO 8601 格式的時間標籤,列出此時間之前的更改
- GET /api/changes/(int: id)/¶
返回有關翻譯更改的資訊。
- 參數值:
id (int) – 變更 ID
- Response JSON Object:
unit (string) – 相關單元物件的網址
translation (string) – 相關翻譯對象的 URL
component (string) – 相關組件物件的網址
user (string) – 相關使用者對象的 URL
author (string) – 相關作者對象的 URL
timestamp (timestamp) – 事件時間戳記
action (int) – 動作的幾種識別
action_name (string) – 動作的文本描述
target (string) – event changed text
old (string) – previous text
details (object) – additional details about the change
id (int) – 更改的識別文字
螢幕擷圖¶
- GET /api/screenshots/¶
返回螢幕截圖字串資訊的列表。
也參考
螢幕截圖對象的屬性存檔在
GET /api/screenshots/(int:id)/
。
- GET /api/screenshots/(int: id)/¶
返回與螢幕截圖資訊有關的資訊。
- 參數值:
id (int) – 螢幕擷圖 ID
- Response JSON Object:
name (string) – 螢幕截圖的名稱
component (string) – 相關組件物件的網址
file_url (string) – 下載文件的 URL;請參見
GET /api/screenshots/(int:id)/file/
units (array) – 與源字串資訊相關的連結;請參見
GET /api/units/(int:id)/
- GET /api/screenshots/(int: id)/file/¶
下載螢幕截圖的圖片。
- 參數值:
id (int) – 螢幕擷圖 ID
- POST /api/screenshots/(int: id)/file/¶
替換螢幕截圖。
- 參數值:
id (int) – 螢幕擷圖 ID
- 表格參數:
file image – 上傳文件
CURL 示例:
curl -X POST \ -F image=@image.png \ -H "Authorization: Token TOKEN" \ http://example.com/api/screenshots/1/file/
- POST /api/screenshots/(int: id)/units/¶
與螢幕截圖相關的源字串。
- 參數值:
id (int) – 螢幕擷圖 ID
- 表格參數:
string unit_id – 單元 ID
- Response JSON Object:
name (string) – 螢幕截圖的名稱
translation (string) – 相關翻譯對象的 URL
file_url (string) – 下載文件的 URL;請參見
GET /api/screenshots/(int:id)/file/
units (array) – 與源字串資訊相關的連結;請參見
GET /api/units/(int:id)/
- DELETE /api/screenshots/(int: id)/units/(int: unit_id)¶
Remove source string association with screenshot.
- 參數值:
id (int) – 螢幕擷圖 ID
unit_id – 來源字串單元 ID
- POST /api/screenshots/¶
新建新的螢幕截圖。
- 表格參數:
file image – 上傳文件
string name – 畫面快照名稱
string project_slug – 項目標識串
string component_slug – 組件標識串
string language_code – 語言碼
- Response JSON Object:
name (string) – 螢幕截圖的名稱
component (string) – 相關組件物件的網址
file_url (string) – 下載文件的 URL;請參見
GET /api/screenshots/(int:id)/file/
units (array) – 與源字串資訊相關的連結;請參見
GET /api/units/(int:id)/
- PATCH /api/screenshots/(int: id)/¶
編輯有關螢幕擷圖的部分資訊。
- 參數值:
id (int) – 螢幕擷圖 ID
- Response JSON Object:
name (string) – 螢幕截圖的名稱
component (string) – 相關組件物件的網址
file_url (string) – 下載文件的 URL;請參見
GET /api/screenshots/(int:id)/file/
units (array) – 與源字串資訊相關的連結;請參見
GET /api/units/(int:id)/
- PUT /api/screenshots/(int: id)/¶
編輯有關螢幕擷圖的完整資訊。
- 參數值:
id (int) – 螢幕擷圖 ID
- Response JSON Object:
name (string) – 螢幕截圖的名稱
component (string) – 相關組件物件的網址
file_url (string) – 下載文件的 URL;請參見
GET /api/screenshots/(int:id)/file/
units (array) – 與源字串資訊相關的連結;請參見
GET /api/units/(int:id)/
- DELETE /api/screenshots/(int: id)/¶
刪除螢幕擷圖。
- 參數值:
id (int) – 螢幕擷圖 ID
附加元件¶
在 4.4.1 版被加入.
- GET /api/addons/¶
返回附加元件列表。
也參考
附加元件對象屬性記錄在
GET /api/units/(int:id)/
。
- GET /api/addons/(int: id)/¶
傳回有關附加元件的資訊。
- 參數值:
id (int) – Add-on ID
- Response JSON Object:
name (string) – 附加元件的名稱
component (string) – 相關組件物件的網址
configuration (object) – 選擇性的附加元件組態
也參考
- POST /api/components/(string: project)/(string: component)/addons/¶
建立一個新的附加元件。
- 參數值:
project_slug (string) – 項目標識串
component_slug (string) – 組件標識串
- Request JSON Object:
name (string) – 附加元件的名稱
configuration (object) – 選擇性的附加元件組態
- PATCH /api/addons/(int: id)/¶
編輯有關附加元件的部分資訊。
- 參數值:
id (int) – Add-on ID
- Response JSON Object:
configuration (object) – 選擇性的附加元件組態
- PUT /api/addons/(int: id)/¶
編輯有關附加元件的完整資訊。
- 參數值:
id (int) – Add-on ID
- Response JSON Object:
configuration (object) – 選擇性的附加元件組態
- DELETE /api/addons/(int: id)/¶
刪除附加元件。
- 參數值:
id (int) – Add-on ID
組件列表¶
在 4.0 版被加入.
- GET /api/component-lists/¶
返回組件列表的列表。
也參考
組件列表對象屬性存檔在
GET /api/component-lists/(str:slug)/
。
- GET /api/component-lists/(str: slug)/¶
返回組件列表的資訊。
- 參數值:
slug (string) – 組件列表的標識串
- Response JSON Object:
name (string) – 組件列表的名稱
slug (string) – 組件列表的表示串
show_dashboard (boolean) – 是否在儀錶板上顯示
components (array) – 相關聯組件的連接;請參見
GET /api/components/(string:project)/(string:component)/
auto_assign (array) – 自動分配規則
- PUT /api/component-lists/(str: slug)/¶
更改組件列表參數。
- 參數值:
slug (string) – 組件列表的標識串
- Request JSON Object:
name (string) – 組件列表的名稱
slug (string) – 組件列表的表示串
show_dashboard (boolean) – 是否在儀錶板上顯示
- PATCH /api/component-lists/(str: slug)/¶
更改組件列表參數。
- 參數值:
slug (string) – 組件列表的標識串
- Request JSON Object:
name (string) – 組件列表的名稱
slug (string) – 組件列表的表示串
show_dashboard (boolean) – 是否在儀錶板上顯示
- DELETE /api/component-lists/(str: slug)/¶
刪除組件列表。
- 參數值:
slug (string) – 組件列表的標識串
- GET /api/component-lists/(str: slug)/components/¶
在 5.0.1 版被加入: 列出組件列表中的組件。
- param slug:
組件列表的標識串
- type slug:
字串
- form string component_id:
組件 ID
- >json array results:
組件對象的矩陣;請參見
GET /api/components/(string:project)/(string:component)/
- POST /api/component-lists/(str: slug)/components/¶
使組件與組件列表相關。
- 參數值:
slug (string) – 組件列表的標識串
- 表格參數:
string component_id – 組件 ID
- DELETE /api/component-lists/(str: slug)/components/(str: component_slug)¶
將組件與組件列表接觸相關性。
- 參數值:
slug (string) – 組件列表的標識串
component_slug (string) – 組件標識串
詞彙表¶
在 4.5 版的變更: 表格現在儲存為常規元件,翻譯和字串,請使用相應的API。
任務¶
在 4.4 版被加入.
- GET /api/tasks/¶
Listing of the tasks is currently not available.
- GET /api/tasks/(str: uuid)/¶
傳回有關任務的資訊。
- 參數值:
uuid (string) – 任務 UUID
- Response JSON Object:
completed (boolean) – Whether the task has completed
progress (int) – 任務進度百分比
result (object) – 任務結果或過程細節
log (string) – 任務日誌
統計數據¶
- GET /api/(str: object)/statistics/¶
There are several statistics endpoints for objects and all of them contain same structure.
- 參數值:
object (string) – 網址路徑
- Response JSON Object:
total (int) – 字串的總數
total_words (int) – 詞的總數
total_chars (int) – total number of characters
last_change (timestamp) – 上次更改的日期
translated (int) – 已翻譯的字串數量
translated_percent (float) – 已翻譯字串的百分比
translated_words (int) – 已翻譯詞的數量
translated_words_percent (float) – 已翻譯詞的百分比
translated_chars (int) – 已翻譯字元的數量
translated_chars_percent (float) – 已翻譯字元的百分比
fuzzy (int) – number of fuzzy (marked for edit) strings
fuzzy_words (int) – number of fuzzy (marked for edit) words
fuzzy_chars (int) – number of fuzzy (marked for edit) characters
fuzzy_percent (float) – 模糊字串 (標記為需要編輯)的百分比
fuzzy_words_percent (float) – percentage of fuzzy (marked for edit) words
fuzzy_chars_percent (float) – percentage of fuzzy (marked for edit) characters
failing (int) – 檢查失敗的數量
failing_percent (float) – 檢查失敗的百分比
approved (int) – 已核可的字串數量
approved_words (int) – 已核可的字數
approved_chars (int) – 已核可的字元數
approved_percent (float) – 已核可字串的百分比
approved_words_percent (float) – percentage of approved words
approved_chars_percent (float) – percentage of approved characters
readonly (int) – 唯讀字串的數量
readonly_words (int) – number of read-only words
readonly – 唯讀字元的數量
readonly_percent (float) – percentage of read-only strings
readonly_words_percent (float) – percentage of read-only words
readonly_char_percent (float) – percentage of read-only characters
suggestions (int) – number of strings with suggestions
comments (int) – number of strings with comments
name (string) – 物件名稱
url (string) – URL to access the object (if applicable)
url_translate (string) – URL to access the translation (if applicable)
code (string) – language code (if applicable)
也參考
GET /api/languages/(string:language)/statistics/
,GET /api/projects/(string:project)/statistics/
,GET /api/categories/(int:id)/statistics/
,GET /api/components/(string:project)/(string:component)/statistics/
,GET /api/translations/(string:project)/(string:component)/(string:language)/statistics/
指標¶
- GET /api/metrics/¶
Returns server metrics.
在 5.6.1 版的變更: Metrics can now be exposed in OpenMetrics compatible format with
?format=openmetrics
.- Response JSON Object:
units (int) – Number of units
units_translated (int) – Number of translated units
users (int) – Number of users
changes (int) – 變更數
projects (int) – Number of projects
components (int) – 元件數目
translations (int) – Number of translations
languages (int) – Number of used languages
checks (int) – Number of triggered quality checks
configuration_errors (int) – Number of configuration errors
suggestions (int) – Number of pending suggestions
celery_queues (object) – Celery 排程序列的長度。參閱 使用 Celery 的後台任務
name (string) – Configured server name
搜尋¶
- GET /api/search/¶
在 4.18 版被加入.
Returns site-wide search results as a list. There is no pagination on the result set, only first few matches are returned for each category.
- Response JSON Object:
name (str) – Name of the matched item.
url (str) – Web URL of the matched item.
category (str) – Category of the matched item.
類別¶
- GET /api/categories/¶
在 5.0 版被加入.
Lists available categories. See
GET /api/categories/(int:id)/
for field definitions.
- POST /api/categories/¶
在 5.0 版被加入.
Creates a new category. See
GET /api/categories/(int:id)/
for field definitions.
- GET /api/categories/(int: id)/¶
在 5.0 版被加入.
- 參數值:
id (int) – 類別 ID
- Response JSON Object:
name (str) – Name of category.
slug (str) – Slug of category.
project (str) – Link to a project.
category (str) – Link to a parent category.
- PATCH /api/categories/(int: id)/¶
在 5.0 版被加入: 編輯有關類別的部分資訊。
- 參數 id:
類別 ID
- 類型 id:
int
- >json object configuration:
Optional category configuration
- PUT /api/categories/(int: id)/¶
在 5.0 版被加入: 編輯有關類別的完整資訊。
- 參數 id:
類別 ID
- 類型 id:
int
- >json object configuration:
Optional category configuration
- DELETE /api/categories/(int: id)/¶
在 5.0 版被加入: 刪除類別。
- 參數 id:
類別 ID
- 類型 id:
int
通知掛勾¶
通知鉤子允許外部應用來通知 Weblate 版本控制系統(VCS)儲存庫已經更新。
可以為專案、組件和翻譯使用儲存庫端點來更新各自的儲存庫;文件請參見 POST /api/projects/(string:project)/repository/
。
- GET /hooks/update/(string: project)/(string: component)/¶
在 2.6 版之後被棄用: 請使用
POST /api/components/(string:project)/(string:component)/repository/
來替代,它使用 ACL 限制的身份驗證而工作正常。觸發組件的更新(從版本控制系統 VCS 拉取並掃描翻譯的更改)。
- GET /hooks/update/(string: project)/¶
在 2.6 版之後被棄用: 請使用
POST /api/projects/(string:project)/repository/
來替代,它使用 ACL 限制的身份驗證而工作正常。觸發項目中所有組件的更新(從版本控制系統 VCS 拉取並掃描翻譯的更改)。
- POST /hooks/github/¶
處理 Github 通知與自動更新匹配組件的特殊鉤子。
備註
GitHub 包括了對通知 Weblate 的直接支援:在儲存庫設定中啟動 Weblate 服務掛勾,並將 URL 設定為您的 Weblate 安裝的 URL。
也參考
- 從 GitHub 自動接收更改
關於設定 Github 整合的指令
- https://docs.github.com/en/get-started/customizing-your-github-workflow/exploring-integrations/about-webhooks
GitHub Webhooks 的一般資訊
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
- POST /hooks/gitlab/¶
處理 GitLab 通知並自動更新匹配組件的特殊鉤子。
也參考
- 從 GitLab 自動接收更改
關於設定 GitLab 整合的指示
- https://docs.gitlab.com/ee/user/project/integrations/webhooks.html
關於 GitLab Webhooks 的一般資訊
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
- POST /hooks/bitbucket/¶
處理 Bitbucket 通知並自動更新匹配的組件的特殊鉤子。
也參考
- 從 Bitbucket 自動接收更改
關於設定 Bitbucket 整合的指示
- https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/
關於 Bitbucket Webhooks 的一般資訊
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
- POST /hooks/pagure/¶
處理 Pagure 通知並自動更新匹配的組件的特殊鉤子。
也參考
- 從 Pagure 自動接受更改
關於設定 Pagure 整合的指示
- https://docs.pagure.org/pagure/usage/using_webhooks.html
關於 Pagure Webhooks 的一般資訊
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
- POST /hooks/azure/¶
Special hook for handling Azure DevOps notifications and automatically updating matching components.
備註
Please ensure that Resource details to send is set to All, otherwise Weblate will not be able to match your Azure repository.
也參考
- 從 Azure Repos 自動接收更改
關於設定 Azure 整合的指示
- https://learn.microsoft.com/en-us/azure/devops/service-hooks/services/webhooks?view=azure-devops
Generic information about Azure DevOps Web Hooks
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
- POST /hooks/gitea/¶
處理 Gitea Webhook 通知並自動更新匹配的組件的特殊鉤子。
也參考
- 從 Gitea Repos 自動接收更改
關於設定 Gitea 整合的指示
- https://docs.gitea.io/zh-tw/webhooks/
關於 Gitea Webhooks 的一般資訊
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
- POST /hooks/gitee/¶
處理 Gitee Webhook 通知並自動更新匹配的組件的特殊鉤子。
也參考
- 從 Gitee Repos 自動接收更改
關於設定 Gitee 整合的指示
- https://gitee.com/help/categories/40
關於 Gitee Webhooks 的一般資訊
ENABLE_HOOKS
關於對整個 Weblate 啟動鉤子
匯出¶
Weblate 提供各種導出,允許進一步處理資料。
- GET /exports/stats/(string: project)/(string: component)/¶
- 查詢參數:
format (string) – 輸出格式:
json
或csv
在 2.6 版之後被棄用: 請替代使用:http:get:/api/components/(string:project)/(string:component)/statistics/ 和:http:get:/api/translations/(string:project)/(string: component)/(string:language)/statistics/;它也允許存取ACL 控制的項目。
為給定的組件以給定的格式檢索統計資料。
示例請求:
GET /exports/stats/weblate/main/ HTTP/1.1 Host: example.com Accept: application/json, text/javascript
示例響應:
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/main/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/main/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/main/el/" } ]
RSS 消息來源¶
翻譯的更改導出到 RSS 頻道。
- GET /exports/rss/(string: project)/(string: component)/(string: language)/¶
用翻譯近期的更改檢索 RSS 頻道。
- GET /exports/rss/(string: project)/(string: component)/¶
用組件的近期更改檢索 RSS 頻道。
- GET /exports/rss/(string: project)/¶
用項目的近期更改檢索 RSS 頻道。
- GET /exports/rss/language/(string: language)/¶
用語言的近期更改檢索 RSS 頻道。
- GET /exports/rss/¶
用 Weblate 事件的近期更改檢索 RSS 頻道。
也參考