pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Machinery text replaces text in source editor instead of just adding it

Open bugzilla-to-github opened this issue 5 years ago • 4 comments

This issue was created automatically by a script.

Bug 1682137

Bug Reporter: @abowler2 CC: @mathjazz

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

Selected an entry in order to 'Copy into translation' from the machinery tab

Actual results:

When in the standard FTL view (table view) the editor text is replaced instead of just added to.

Expected results:

The text from the machinery tab should have just been added to the editor rather than replacing the editor contents.

bugzilla-to-github avatar Dec 12 '20 05:12 bugzilla-to-github

Comment Author: @abowler2

I found an older branch in my local environment from before the editor changes, and after testing things out on that branch I see that the behavior in the standard FTL view (table view) is correct.

However, when changing to the advanced FTL view the entire contents of the editor are replaced with the text from machinery, including the Fluent syntax. In addition the editor crashes when trying to switch back to the standard FTL view.

bugzilla-to-github avatar Dec 12 '20 07:12 bugzilla-to-github

Comment Author: @mathjazz

I have second thoughts about this one. Why should we add, instead of replace text?

Here are some of the examples I've looked at: https://pontoon.mozilla.org/sl/firefox/all-resources/?string=200662 https://pontoon.mozilla.org/sl/firefox/all-resources/?string=200849 https://pontoon.mozilla.org/sl/firefox/all-resources/?string=192297

We feed Machinery with the simple preview of the source string, which is typically the default variant. That means the results offered by the Machinery are useful as is or with small modifications. Unlike with Concordance Search, where one could search for a term, which is part of a string.

April, could you remind us what was the motivation to file this bug?

bugzilla-to-github avatar Aug 10 '21 22:08 bugzilla-to-github

Comment Author: @abowler2

Created attachment 9235904 Machinery replaces contents and crashes after

Here is the behavior that this bug was attempting to describe. This is with Machinery terms and not search results, though the same behavior happens with search terms too.

Attached file: Machinery-FTL.mov (video/quicktime, 6727619 bytes) Description: Machinery replaces contents and crashes after

bugzilla-to-github avatar Aug 11 '21 13:08 bugzilla-to-github

Comment Author: @mathjazz

Thanks for clarifying! I thought the bug was about the Rich Editor (not Source Editor).

So instead of replacing text as it happens when copying from the Locales tab, we should add Machinery results to the source editor as we already do for Terms, Placeables and Concordance Search results.

bugzilla-to-github avatar Aug 12 '21 19:08 bugzilla-to-github

In the meanwhile we have changed the behavior of copying strings from Machinery. Text is now replaced in both, the rich editor field or the source editor, but we always make sure the resulting Fluent message is valid. For example, when a value is copied to the source editor, that results in the following content: source-string-id = Copied value.

mathjazz avatar Jan 18 '24 09:01 mathjazz