Bug 421330 - Issue for Paste/Copy from the original string to the translated string
Summary: Issue for Paste/Copy from the original string to the translated string
Status: REPORTED
Alias: None
Product: lokalize
Classification: Applications
Component: editor (show other bugs)
Version: 20.04
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-11 11:20 UTC by Xavier Besnard
Modified: 2021-06-17 10:44 UTC (History)
2 users (show)

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


Attachments
Screenshots before after the copy/paste of [Flathub](https://flathub.org/home) (370.69 KB, image/png)
2020-05-11 11:20 UTC, Xavier Besnard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Besnard 2020-05-11 11:20:37 UTC
Created attachment 128358 [details]
Screenshots before after the copy/paste of [Flathub](https://flathub.org/home)

SUMMARY
I copy some part of the original string when the translation is unnecessary (app name, web link, ...). Then I copy then in the box for the translated string. The result is incorrect with some part of the copy at another place. 


STEPS TO REPRODUCE
1. Copy a string in the string to translate
2. Click in the translated string for a paste copy
3. Incorrect result of the paste/copy with the modification of the text outside the paste/copy zone (refer to attached picture)

Config: Kubuntu 20.10 Dev ° plasmashell 5.18.5


OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Xavier Besnard 2020-05-11 11:21:21 UTC
Observed many times on diffent files under translation
Comment 2 Simon Depiets 2020-06-14 08:22:45 UTC
There was a bug like this a few years ago with the cursor jumping but that was fixed. I just installed a kubuntu 20.10 on a virtual machine and I can't reproduce.

When you drag and drop from the source it also gets inserted randomly ?
Comment 3 Xavier Besnard 2020-06-14 09:42:57 UTC
Bonjour Simon.

Même avec un Glisser-Déposer, cela arrive et des morceaux du bloc 
récepteur sont effacés. J'ai tenté de le montrer avec les copies d'écran 
jointes à mon rapport de bogue.

Je suis sous Kubuntu Dév Groovy avec les backports, plasmashell 5.18.5 
et lokalize 20.04.1

Que puis je faire pour toi pour cerner le pb?

A+. Xavier

Le 14/06/2020 à 10:22, Simon Depiets a écrit :
> https://bugs.kde.org/show_bug.cgi?id=421330
>
> --- Comment #2 from Simon Depiets <sdepiets@gmail.com> ---
> There was a bug like this a few years ago with the cursor jumping but that was
> fixed. I just installed a kubuntu 20.10 on a virtual machine and I can't
> reproduce.
>
> When you drag and drop from the source it also gets inserted randomly ?
>
Comment 4 Simon Depiets 2020-06-14 09:46:55 UTC
C'est répétable ou aléatoire ? Si c'est aléatoire c'est une fois tous les combien de copier-coller ? Si tu colles 10 fois le texte à la fin est-ce que y'a une fois où il va se mettre autre part?
Comment 5 Xavier Besnard 2020-06-16 10:10:47 UTC
Le déclenchement est aléatoire mais cela arrive régulièrement de l'ordre 
de 1 fois sur 10, à la louche car je ne compte pas.

Cela peut se faire sur un glisser/déposer entre la source et la 
destination ou un copier/coller.

Insérer des lignes avant de faire l'action ne change rien. Le refaire 
plus fois à des endroits différents ne change rien. Je perds du texte 
hors de la zone de modif.

Par contre, si je fais un copier/coller dans nano et que je refais la 
copie, alors cela marche correctement (fait plusieurs fois).

Maintenant, je contourne en faisant des copies globales de la source 
vers la destination. Du coup, je compte moins les occurences.

A+. Xavier


Le 14/06/2020 à 11:46, Simon Depiets a écrit :
> https://bugs.kde.org/show_bug.cgi?id=421330
>
> --- Comment #4 from Simon Depiets <sdepiets@gmail.com> ---
> C'est répétable ou aléatoire ? Si c'est aléatoire c'est une fois tous les
> combien de copier-coller ? Si tu colles 10 fois le texte à la fin est-ce que
> y'a une fois où il va se mettre autre part?
>
Comment 6 Paolo Zamponi 2021-06-17 10:44:09 UTC
Hi! Sorry for my French (and for my English too...), but it seems you noticed an issue related to Paste/Copy action. I can confirm. Yesterday I filed a bug:

https://bugs.kde.org/show_bug.cgi?id=438741

which is maybe related to this (or maybe it's a duplicate one, in that case I'm sorry): I noticed this issue (and mine) are triggered by a drag-and-drop operation in the translated message. Try this:

1. Open Lokalize and select a "short" message;
2. Translate it (if it's not);
3. Select a word in the message, copy it in the clipboard and move it at the end of the message with a drag-and-drop operation;
4. Now select a longer one instead, and translate it;
5. Try to paste your copied words near the end of it: some characters (it seems in the position you dragged and of the same amount) in the beginning of it are deleted.
6. Close and reopen Lokalize;
7. Now try to perform your drag-and-drop operation at the end of a "long" message;
8. Select a shorter one and try to paste: now it works fine.

It seems that Lokalize "remembers" the position and the amount of the moved characters after you performed another drag-and-drop operation...