Bug 302841 - Additional parentheses at the end of strings finished in parentheses added from an alternative translation
Summary: Additional parentheses at the end of strings finished in parentheses added fr...
Status: CONFIRMED
Alias: None
Product: lokalize
Classification: Applications
Component: editor (show other bugs)
Version: 1.4
Platform: Chakra Linux
: NOR minor
Target Milestone: ---
Assignee: Adrián Chaves (Gallaecio)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-01 16:02 UTC by Adrián Chaves (Gallaecio)
Modified: 2022-03-13 20:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrián Chaves (Gallaecio) 2012-07-01 16:02:17 UTC
For example, if the alternative translation field has the content “Branco-Cinzento (horizontal)” and I get it copied to the main field, a parentheses, “)”, is attached at the end, resulting in the main translation field being filled with the following string: “Branco-Cinzento (horizontal))”.

Reproducible: Always
Comment 1 Karl Ove Hufthammer 2015-06-05 18:48:54 UTC
I can confirm this with the latest Lokalize version. It also happens with other punctuation (e.g., a full stop: .).

One example I tried makes me *suspect* that the extra character is actually from the original (English) string, not from the alternative translation.
Comment 2 Pavel Horal 2022-03-13 20:31:13 UTC
This is caused by some "magic" (this word is used in the code itself) trying to preserve non-word characters at the start and end of the string:

- https://invent.kde.org/sdk/lokalize/-/blob/master/src/tm/tmview.cpp#L830

This feature was introduced 14 years ago and I am not sure what was the original motivation - https://invent.kde.org/sdk/lokalize/-/commit/3765f371f02b4a2b33118c0e7f95e3fc5ae6134f . It might make sense in some very limited use case related to KDE. Would be nice if this "black magic" can be at least turn off if not completely removed.

Disclamer: I am not KDE app developer and I am using (or trying to use) Lokalize for personal translation project.