Part of a translated substring is matched and translated again by a subsequent translation rule
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gufw |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Symptoms:
In Italian, "OUT" is translated "IN USCITA". Subsequently, the substring "IN" from the previous translation is retranslated with "IN ENTRATA". The resulting translated rule is "IN ENTRATA USCITA", which sounds approximately like this: "INCOMING OUTGOING", which is very wrong and misleading, especially for the unsuspecting user...
Analysis:
File gufw/gufw/
Lines 712-734
The string in "translated_rule" variable is manipulated recursively - I mean that the output of one replace() becomes the input of the next - and in this way the entire translated text is also compared with the search string of the next replace(). This causes the bug.
Initially, I experimented a little bit and tried to replace all the translations at once, but some of them actually RELY on some overlap between the previously translated text and the next one, because the search string is surrounded by spaces (I suspect the intention is to match only whole words) and the replace string contains the same spaces. But if you happen to have to translate two adjacent words separately, they only have one space between them, and it is in common.
Solution:
in the hope of doing something useful, I wrote a little patch.
It takes account of any overlapping of spaces and ensures the separation between the translated text and the text still to be translated.
A little caveat:
This is my very first contribution to an opensource project and I am not a bazaar user, so I did my best to provide a solution along with the problem.
Changed in gui-ufw: | |
status: | Opinion → New |
Hi Guido,
Thanks for the patch, but I don't like to change code because one language has one issue.
Could you ask to your team translators about a fix changing those strings? I think that would be the right solution.
Thanks in advance!