Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add option to prevent pre-filling translations #58451

Closed
@jawira

Description

@jawira

Description

Hello Symfony Team. I'm working on a Symfony project where we manage our translations using the translation:extract command, and our team uses Weblate to handle the actual translation process. However, we’ve encountered an issue when extracting translation strings. The command currently pre-fills the <target> tags with the source message, and this slows down our translation workflow.

When the translation:extract command is executed, the <target> tags are automatically populated with the same values as the <source> tags. For example:

<trans-unit id="haoBXCQ" resname="inventory.item_status.missing">
    <source>inventory.item_status.missing</source>
    <target>inventory.item_status.missing</target>
</trans-unit>

This behavior causes Weblate to consider the string is already translated, which slows down our translation team workflow. Ideally, the <target> tags should be empty when the translation file is updated, so Weblate can identify that the strings still require translation.

Example

It would be incredibly helpful if the translation:extract command could offer an additional option (e.g., --no-fill or --empty-target). This option would prevent the command from automatically filling the <target>, leaving them empty by default. For example:

bin/console translation:extract --force --prefix="" --no-fill fr
<trans-unit id="haoBXCQ" resname="inventory.item_status.missing">
    <source>inventory.item_status.missing</source>
    <target></target>
</trans-unit>

This would help us better integrate Symfony's translation system with Weblate (and potentially other translation management tools) that rely on empty tags to detect untranslated strings.

Thank you for considering this feature request :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureHelp wantedIssues and PRs which are looking for volunteers to complete them.Translation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions