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

Weblate and lupdate fighting over XML entities/non-breaking spaces. #5917

Closed
1 task done
rubdos opened this issue Apr 25, 2021 · 6 comments · Fixed by translate/translate#4330
Closed
1 task done
Assignees
Labels
enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit

Comments

@rubdos
Copy link

rubdos commented Apr 25, 2021

Describe the issue

It looks like Qt linguist's lupdate command prefers HTML entities and Weblate prefers the effective UTF-8 character.

I regularly run lupdate qml/ -ts translations/*.ts on my project (in CI), and use Weblate to translate.
Weblate regularly sends me diffs of the form:

-        <translation>Whisperfish neu starten&#xa0;…</translation>
+        <translation>Whisperfish neu starten …</translation>

and lupdate reverts that:

-        <translation>Whisperfish neu starten …</translation>
+        <translation>Whisperfish neu starten&#xa0;…</translation>

Since I'm running lupdate in CI (for line number tracking, mostly), this is getting quite noisy.
Especially since French seems also affected for some HTML entities.

I already tried

Describe the steps you tried to solve the problem yourself.

  • I've read and searched the docs and did not find the answer there.
    If you didn’t try already, try to search there what you wrote above.

To Reproduce the issue

Steps to reproduce the behavior:

  1. Have a project with German and a  
  2. Run lupdate manually
  3. Change any unrelated string in German
  4. Have Weblate trigger a commit

Expected behavior

On of the following:

  • lupdate shouldn't alter the entities
  • Weblate should only trigger an update in the commit for the relevant string if the string has actually changed.
  • Weblate can be configured to prefer encoding the entity instead of the raw UTF-8 character.

Screenshots

n.a., I think the diffs above should be enough

Exception traceback

n.a.

Server configuration and status

weblate.org

Additional context

Public and open source project, here are the links:

@rubdos rubdos added the question This is more a question for the support than an issue. label Apr 25, 2021
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you!

@nijel
Copy link
Member

nijel commented Apr 25, 2021

The file formats are handled by https://github.com/translate/translate/, for most formats full serialization is done even on change, so these kind of differences can happen. In this particular case I'd prefer to fix translate-toolkit to save the strings in a same way as lupdate does. The question is what are the rules here - what should be stored as entities...

@rubdos
Copy link
Author

rubdos commented Apr 26, 2021

whisperfish/translations
❯ rg '&..?.?.?;' -oI --no-heading | sort | uniq 
&apos;
&quot;
&#xa0;

Honestly, given that my files have a UTF-8 XML header, I would expect Qt Linguist to be a good citizen and print them as UTF-8 too, but I don't think I'd be able to pull that off with Qt.

@nijel nijel added enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit and removed question This is more a question for the support than an issue. labels Apr 27, 2021
@nijel nijel self-assigned this Apr 27, 2021
@github-actions
Copy link

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

@nijel
Copy link
Member

nijel commented Apr 27, 2021

translate/translate#4330 should address this.

nijel added a commit to translate/translate that referenced this issue Apr 27, 2021
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. translate-toolkit Issues which need to be fixed in the translate-toolkit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants