Is it possible to activate an addon while creating a new component via API? #11107
Unanswered
JohnRDOrazio
asked this question in
Q&A
Replies: 1 comment 2 replies
-
No, add-ons have to be installed in an additional API call. If this is something you often do, you might want to use https://docs.weblate.org/en/latest/admin/config.html#default-addons. PS: The upcoming release will bring possibilty to install add-ons on project or site scopes as well: |
Beta Was this translation helpful? Give feedback.
2 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I have started working recently with the weblate API in order to automatically create project components from InDesign documents. I was just wondering, when creating a component using
fetch
withPOST
method tohttps://{path-to-weblate-api}/projects/{project-slug}/components/
, is it possible to enable addons at the same time? Or does this have to be done in a successive API call?I have successfully activated an addon with a successive API call to the
https://{path-to-weblate-api}/components/{project-slug}/{component-slug}/addons/
endpoint usingPOST
method with a value like this:and I see that the addon is successfully activated.
I have attempted to do the addon activation at time of component creation by adding an
addons
key to the JSON payload with the same value as above wrapped in an array:addons: [ { name: "weblate.autotranslate.autotranslate", configuration: { ... } } ]
. However this does not seem to work. Is it possible to activate addons during component creation in a single call?Beta Was this translation helpful? Give feedback.
All reactions