When I create a weblate
addon (component discovery) with the REST API
,
**'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
does not automatically get the files that I push in the git
repository.
To make it work, I first need to manually
- go to the discovery addon webpage in the web browser,
- save the addon in the web browser
- accept the list of files that match the template in the web browser.
Once this has been done one time, all the files that I push in the git
repository are correctly discovered by weblate
.
However we would like to do the 1), 2) & 3) steps automatically with the REST API
.
I tried to set the confirm and preview fields of our CURL
request to false but it does not work.
Is there a way to configure the CURL
request so that weblate
discover the files without any manual steps?
Warm regards.