-
I've added a hook to our Gitlab to automatically create translation projects for new code via the Weblate API. The hook creates a project, adds an initial component and then adds the extensions we want/need: weblate.discovery.discovery, weblate.consistency.languages, weblate.autotranslate.autotranslate. Autotranslate and consistency are added at project level. Discovery is working perfectly. But it seems I'm missing something for consistency and autotranslate. When I add the two via the web UI they immediately trigger and I get the missing languages with their automatic translations. When added via API I have to wait until the next day until I get the same results. Is there a specific order in which I should add the extensions? Should I insert a delay between adding extensions? Do I need an extra parameter or API call to trigger them? Any hints appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The add-ons should be always triggered upon installation, but this happens asynchronously, so if you do that from API they won't see changes done by installing the other one because they would be executed in parallel. But if you are installing these at the project scope, installing the add-ons before creating the component should work fine. |
Beta Was this translation helpful? Give feedback.
-
I've now tried without "consistency" and with "autotranslate" moved to before component creation. As "discovery" has to be installed on the component I can't move this one. But autotranslate still doesn't work. I've found an error message in a task result: "auto_translate_component() missing 1 required positional argument: 'component'". Does this means that autotranslate doesn't work at project level (edit: I'm pretty sure I've seen it work once)? |
Beta Was this translation helpful? Give feedback.
Ah, there is an optional
component
field in the add-on settings and if you omit it, it will break the translation. fd2f496 will fix it, as a workaround just pass an empty string ascomponent
when configuring the add-on.