weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Quality check: spaces around tags

Open miroslavrehor opened this issue 3 years ago • 4 comments

Problem: The translator sometimes does not make correct spaces around tags. For example:

<p>Click on the links<a href="...">here</a>or<a href="...">here</a>.</p>

Solution suggestion: Create new quality check. Logic like:

  • if tag: a, strong, b, i, ...
  • and if following chars are before or after the tag: \p{L}
  • then show a failed check

miroslavrehor avatar Jul 25 '21 10:07 miroslavrehor

The logic probably should be: If there is a space in the source string before/after the tag, it should be in the translation as well.

nijel avatar Jul 26 '21 05:07 nijel

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

github-actions[bot] avatar Jul 26 '21 05:07 github-actions[bot]

The logic probably should be: If there is a space in the source string before/after the tag, it should be in the translation as well.

That is what I thought as well, at first. But then I came across a translated string in our project where this rule does not hold:

msgid "Do fotografie <strong>nevkládejte žádné texty</strong> v jakékoli formě"
msgstr "<strong>Nie wstawiaj żadnego tekstu</strong> do zdjęć w jakiejkolwiek formie"

But for sure, some check is better than none. :-)

miroslavrehor avatar Jul 26 '21 08:07 miroslavrehor

Okay, space or string boundary is probably a better definition.

nijel avatar Jul 26 '21 14:07 nijel