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

Investigate missing french translations in qtAccessionPlugin #1627

Closed
anvit opened this issue Jul 7, 2023 · 4 comments
Closed

Investigate missing french translations in qtAccessionPlugin #1627

anvit opened this issue Jul 7, 2023 · 4 comments
Assignees
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Milestone

Comments

@anvit
Copy link
Contributor

anvit commented Jul 7, 2023

Linked to this Redmine issue. French translations for this plugin seem to be dropped when running a pull from weblate, and trying to import the existing translations (currently present in the 2.7.3 release) into the translations repo seems to have no effect.

It's important to note that unless this issue is fixed, french translations for this file will always be dropped when running a translation pull.

@anvit anvit added the Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result. label Jul 7, 2023
@anvit anvit added this to the 2.8.0 milestone Jul 7, 2023
@anvit anvit self-assigned this Jul 14, 2023
@anvit
Copy link
Contributor Author

anvit commented Jul 19, 2023

Took me a while to figure this out. Turns out this stems from a misplaced ; in a weblate translation, which results in an invalid HTML entity which prevents the translation XML file being loaded.

This translation needs to be corrected on Weblate (there should be no space between gt and ; here):
The translation error in question on Weblate

Ideally vendor/symfony/lib/i18n/sfMessageSource_XLIFF.class.php should have been throwing an exception instead of silently returning false given that Symfony's Message Source load/read functions simply expect loadData to return an array of translations and do not handle this false value on their end.

if (!$xml = simplexml_load_file($filename))
{
$error = false;
return $error;
}

anvit added a commit that referenced this issue Jul 19, 2023
Throwing an exception when Symfony runs into issues when loading XLIFF
files. This will help with catching broken XML files due to translation
errors. Without any error handling, this would lead Symfony to use an
empty array as the array of translations when it is unable to read XML
files, and would make it delete all existing translations for such a
file.
@anvit anvit linked a pull request Jul 19, 2023 that will close this issue
@anvit
Copy link
Contributor Author

anvit commented Jul 19, 2023

I've fixed the problem string in Weblate as well, and it is now just awaiting review.

anvit added a commit that referenced this issue Sep 15, 2023
Throwing an exception when Symfony runs into issues when loading XLIFF
files. This will help with catching broken XML files due to translation
errors. Without any error handling, this would lead Symfony to use an
empty array as the array of translations when it is unable to read XML
files, and would make it delete all existing translations for such a
file.
anvit added a commit that referenced this issue Sep 15, 2023
Throwing an exception when Symfony runs into issues when loading XLIFF
files. This will help with catching broken XML files due to translation
errors. Without any error handling, this would lead Symfony to use an
empty array as the array of translations when it is unable to read XML
files, and would make it delete all existing translations for such a
file.
@anvit
Copy link
Contributor Author

anvit commented Sep 15, 2023

PR has been merged but leaving this open until the Weblate translation that was causing problems is approved.

@anvit
Copy link
Contributor Author

anvit commented Sep 19, 2023

Weblate translation has been approved!

@anvit anvit closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant