Skip to content

feat(api): add support for cloning from a component#18671

Draft
nijel wants to merge 2 commits intoWeblateOrg:mainfrom
nijel:clone-api
Draft

feat(api): add support for cloning from a component#18671
nijel wants to merge 2 commits intoWeblateOrg:mainfrom
nijel:clone-api

Conversation

@nijel
Copy link
Copy Markdown
Member

@nijel nijel commented Mar 26, 2026

Fixes #10362

@nijel nijel requested a review from Copilot March 26, 2026 15:05
@nijel nijel added this to the 5.17 milestone Mar 26, 2026
@nijel nijel self-assigned this Mar 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds REST API capabilities to duplicate components and seed new translations based on existing components, plus extends auto-translation to accept multiple source components.

Changes:

  • Add from_component support when creating components (duplicate configuration + seed translations/add-ons).
  • Add from_component support when creating translations (seed via auto-translation from one or more components).
  • Extend auto-translation plumbing from single source_component_id to source_component_ids.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
weblate/trans/tasks.py Extends component post-save task inputs for seeding; updates auto-translate callsites to list-based sources.
weblate/trans/models/component.py Adds transient seed settings and triggers seeding during after_save.
weblate/trans/management/commands/auto_translate.py Updates management command to pass list-based component sources.
weblate/trans/component_seed.py New module implementing snapshotting + seeding translations and cloning add-ons.
weblate/trans/autotranslate.py Supports multiple source components and ordered preference behavior.
weblate/api/views.py Adds serializer-based validation and translation seeding via auto-translation.
weblate/api/tests.py Adds API tests covering component cloning and translation creation from components.
weblate/api/serializers.py Adds component reference fields/resolution + from_component behavior in component/translation creation.
docs/changes.rst Documents the new REST API from_component option.
docs/api.rst Documents request parameters and examples for from_component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@argos-ci
Copy link
Copy Markdown

argos-ci bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Awaiting the start of a new Argos build…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST API: Allow to clone/duplicate components and translations

2 participants