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

Each <trans-unit> sets "approved=yes" for untranslated strings #136

Closed
carusology opened this issue Sep 14, 2021 · 3 comments
Closed

Each <trans-unit> sets "approved=yes" for untranslated strings #136

carusology opened this issue Sep 14, 2021 · 3 comments

Comments

@carusology
Copy link

Background

This is a bug.

According to the XLIFF file spec, the approved attribute on the <trans-unit> element tracks an approvers "final review" status (Source):

approved

Value description: Approved - Indicates whether a translation is final or has passed its final review.
Boolean: yes or no.
Default value: no
Used in: <trans-unit>, <bin-unit>

However, the current implementation of the serialize_xliff.pm XLIFF serializer sets approved=yes for any string that isn't fuzzy-matched to an existing translated string (Source).

This doesn't make sense. We shouldn't be setting the approved attribute at all in situations where the string hasn't been translated - fuzzy matched or not. There's nothing that can be "approved" at that point.

Task

Update the serialize_xliff.pm serializer to no longer set this attribute if the string isn't translated at all.

@iafan
Copy link
Contributor

iafan commented Sep 14, 2021

So, in other words, 'approved' attribute should be set to 'no' regardless of the fuzzy status if the translation ($unit->{target}) is empty. I think it makes sense. Feel free to provide a PR.

@carusology
Copy link
Author

Well, not quite. The approved attribute is optional (Source):

<trans-unit>
Translation unit - The <trans-unit> elements contains a <source>, <target> and associated elements.

The required id attribute is used to uniquely identify the <trans-unit> within all <trans-unit> and <bin-unit> elements within the same <file>. The optional approved attribute indicates whether the translation has been approved by a reviewer. ... others ...

Required attributes: id.
Optional attributes: approved, ... others ...

I was suggesting omitting it entirely when no translation exists because it's irrelevant. However, since the default for approved is "no" (Source), it's logically the same thing.

@carusology
Copy link
Author

Thanks @iafan! Closed via #137.

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

No branches or pull requests

2 participants