Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty drop creation when empty trans-units are pending translation #990

Draft
wants to merge 2 commits into
base: legacy
Choose a base branch
from

Conversation

wadimw
Copy link

@wadimw wadimw commented Jan 4, 2024

Scenario

An empty trans-unit gets pushed to Mojito.

<trans-unit id="" resname="100_character_description_" datatype="php">
    <source/>
</trans-unit>

It shows up with Needs Translation status but has 0 words.

A drop export is triggered for the repository where all other trans-units have already been translated.

Drop will still get created, because Mojito sees that some trans-unit still needs translation - however, this drop will be empty because a 0-word trans-unit is not included in the drop.

Fix

Updated drop-export command to check if any words need translation, rather than trans-units.

@wadimw wadimw added the legacy Pull requests for legacy Mojito code which should be merged into legacy branch label Jan 4, 2024
@wadimw
Copy link
Author

wadimw commented Jan 4, 2024

This is probably the simplest solution for this case of empty drop creation problem, though it's not complete.

One could argue that:
a. an empty trans-unit should never have a Needs Translation status
b. an empty trans-unit should not be checked in to Mojito at all
c. an empty trans-unit with Needs Translation status should in fact be exported in a drop; a drop import would then accept an empty <target/> (just like a push accepts the empty <source/>) and just carry on as usual (i.e. advance trans-unit status to Pending Review)

Additionally, it's worth noting that there is currently no way to manually change status of an empty trans-unit in Webapp UI, so if we decide on c. we should fix that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy Pull requests for legacy Mojito code which should be merged into legacy branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant