You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.rst
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1079,6 +1079,7 @@ Projects
1079
1079
:type project: string
1080
1080
:form file zipfile: ZIP file to upload into Weblate for translations initialization
1081
1081
:form file docfile: Document to translate
1082
+
: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 into a new local repository. Repository fields such as ``repo``, ``vcs``, ``branch``, ``push``, and ``push_branch`` can not be combined with this option.
1082
1083
:form boolean disable_autoshare: Disables automatic repository sharing via :ref:`internal-urls`.
1083
1084
:<json object: Component parameters, see :http:get:`/api/components/(string:project)/(string:component)/`
1084
1085
:>json object result: Created component object; see :http:get:`/api/components/(string:project)/(string:component)/`
@@ -1163,14 +1164,9 @@ Projects
1163
1164
Content-Length: 20
1164
1165
1165
1166
{
1166
-
"file_format": "po",
1167
-
"filemask": "po/*.po",
1167
+
"from_component": "hello/weblate",
1168
1168
"name": "Weblate",
1169
-
"slug": "weblate",
1170
-
"repo": "weblate://weblate/hello",
1171
-
"template": "",
1172
-
"new_base": "po/hello.pot",
1173
-
"vcs": "git"
1169
+
"slug": "weblate"
1174
1170
}
1175
1171
1176
1172
**JSON response example:**
@@ -1805,6 +1801,7 @@ Components
1805
1801
:param component: Component URL slug
1806
1802
:type component: string
1807
1803
:<json string language_code: translation language code; see :http:get:`/api/languages/(string:language)/`
1804
+
:<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.
1808
1805
:>json object result: new translation object created
Copy file name to clipboardExpand all lines: docs/changes.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Weblate 5.17
9
9
* Shared components can now be categorized within the target project.
10
10
* :ref:`api` supports specifying a category when sharing a component via ``category_id`` parameter.
11
11
* 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.
12
+
* 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.
0 commit comments