簡體   English   中英

Weblate 組件發現 API 不起作用

[英]Weblate component Discovery API not Works

當我使用 REST api 創建 weblate 插件(組件發現)時,

**'curl -X POST -H "Content-Type: application/json" ' +
'-H "Authorization: Token **************" ' +
'-k -d "{' +
'\\"name\\":\\"weblate.discovery.discovery\\",' +
'\\"configuration\\":{' +
'\\"match\\":\\"locales/(?P^<language^>[^^/]*)/(?P^<component^>(?!__TEMPLATE__) ([^^/])*)\\\\.json\\",' +
'\\"file_format\\":\\"i18next\\",' +
'\\"name_template\\":\\"{{ component }}_fr\\",' +
'\\"base_file_template\\":\\"locales/fr/{{component}}.json\\",' +
'\\"new_base_template\\":\\"locales/fr/{{component}}.json\\",' +
'\\"language_regex\\":\\"^^[^^.]+$\\",' +
'\\"copy_addons\\":true,' +
'\\"remove\\":false,' +
'\\"confirm\\":true,' +
'\\"preview\\":true},' +
'\\"url\\":\\"\\"' +
'}" http://127.0.0.1/api/components/repositoryname/__template__fr/addons/'**

, weblate 不會自動獲取我在 git 存儲庫中推送的文件。

To make it work, I first need to manually -1) go to the discovery addon webpage in the web browser, -2) save the addon in the web browser -3) accept the list of files that match the template in the web browser . 一旦這樣做了一次,我在 git 存儲庫中推送的所有文件都會被 weblate 正確發現。 但是,我們希望使用 REST API 自動執行 1)、2) 和 3) 步驟。 我嘗試將我們的 CURL 請求的確認和預覽字段設置為 false,但它不起作用。 有沒有辦法配置 CURL 請求,以便 weblate 在沒有任何手動步驟的情況下發現文件?

溫暖的問候

它應該工作。 剛剛添加了測試來覆蓋我們的測試套件。

我的猜測是 JSON 請求中有問題 - 也許某些東西沒有正確轉義或轉義太多?

curl 請求以什么結尾? 您使用什么 Weblate 版本?

PS:版本信息發布在這里 您需要升級,這已在b9646f23174中修復。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM