Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,7 @@ Projects
:type project: string
:form file zipfile: ZIP file to upload into Weblate for translations initialization
:form file docfile: Document to translate
:form string from_component: Optional source component reference used to duplicate the new component. Accepts either a numeric component ID or a full Weblate component path. When provided, the new component inherits the source component configuration and translations; values explicitly supplied in the request override the inherited configuration. If ``repo`` is omitted, a local repository is created to avoid writing seeded content back to the source repository by default.
:form boolean disable_autoshare: Disables automatic repository sharing via :ref:`internal-urls`.
:<json object: Component parameters, see :http:get:`/api/components/(string:project)/(string:component)/`
:>json object result: Created component object; see :http:get:`/api/components/(string:project)/(string:component)/`
Expand Down Expand Up @@ -1163,11 +1164,11 @@ Projects
Content-Length: 20

{
"from_component": "hello/weblate",
"file_format": "po",
"filemask": "po/*.po",
"name": "Weblate",
"slug": "weblate",
"repo": "weblate://weblate/hello",
"template": "",
"new_base": "po/hello.pot",
"vcs": "git"
Expand Down Expand Up @@ -1805,6 +1806,7 @@ Components
:param component: Component URL slug
:type component: string
:<json string language_code: translation language code; see :http:get:`/api/languages/(string:language)/`
:<json array from_component: optional ordered list of source component references used for automatic translation. Accepts numeric component IDs or full Weblate component paths. For form submissions this field can be provided multiple times.
:>json object result: new translation object created

**CURL example:**
Expand All @@ -1827,7 +1829,10 @@ Components
Authorization: Token TOKEN
Content-Length: 20

{"language_code": "cs"}
{
"language_code": "cs",
"from_component": ["hello/weblate", 123]
}

**JSON response example:**

Expand Down
1 change: 1 addition & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Weblate 5.17
* Shared components can now be categorized within the target project.
* :ref:`api` supports specifying a category when sharing a component via ``category_id`` parameter.
* Added :ref:`addon-weblate.gettext.xgettext`, :ref:`addon-weblate.gettext.django`, and :ref:`addon-weblate.gettext.sphinx` to update POT files with configurable update cadence.
* Added ``from_component`` support to the REST API for creating components from existing component content and for creating translations seeded by automatic translation from existing components.

.. rubric:: Improvements

Expand Down
186 changes: 186 additions & 0 deletions docs/specs/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading