-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
Compare number of HTML/XML entities in check #6478
Comments
This issue has been automatically marked as stale because there wasn’t any recent activity. It will be closed soon if no further action occurs. Thank you for your contributions! |
I think this is not inactive. (Sorry for everyone who now gets a useless notification because of me) Maybe you could update https://github.com/WeblateOrg/weblate/blob/main/.github/ISSUE_TEMPLATE/feature_request.md to add an labels: [Enhancement] so that feature requests are not automatically closed due to inactivity after a few days. |
Sorry, we're a bit slow on triaging things. It's intentional that the template does not contain labels, they should be really set after triaging. What might be useful to you is adding |
Hi, No worries, triaging doesn't need to be fast. But it might be useful then to update the bot to only consider already triaged issues to avoid useless bumps. safe-html can't detect this case at the moment as |
It should bump such issues to push us to triaging. Otherwise, they would be forgotten forever :-). Ah the bleach check doesn't validate whether there are same tags, but that no other tags than in source are used. This should be done by the XML markup check, I think it should catch the string you've mentioned in the initial post. |
This issue has been automatically marked as stale because there wasn’t any recent activity. It will be closed soon if no further action occurs. Thank you for your contributions! |
Is your feature request related to a problem? If so, please describe.
Matomo currently on import of translations contains a check that makes sure translations only contain HTML entities when the source string contains them:
https://github.com/matomo-org/matomo/blob/115527353a9e75e01aa4d263408956ae45403bea/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php
Now when moving to weblate, it would be great if the built-in checks could help with this. I saw in
weblate/weblate/checks/markup.py
that there are already quite a few checks around XML tags and highlighting of entities, so maybe something could be added here.Describe the solution you'd like
A check that warns in e.g. this case:
Source:
<b>some text</b>
Translation:
<b>some text</b>
Maybe a more generalized solution to this would be a check that compares if the same HTML entities are in source and translation. This would also catch the other case where the source text has an entity, but it is missing in the translation.
Describe alternatives you've considered
One could still keep the check as a CI test in Matomo, but having it in weblate makes it easier to fix.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: