Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen junk with latest update #88

Open
StanleyKnife opened this issue Jan 20, 2021 · 17 comments
Open

Screen junk with latest update #88

StanleyKnife opened this issue Jan 20, 2021 · 17 comments
Labels

Comments

@StanleyKnife
Copy link

Describe the bug
When Polyglot is loaded, a pages with Arabic text shows an always-on grey box. Text highlighted for translation shows a spinning box top left.

Screenshots

Always-on box at top, highlighted translation bottom.

Version (please complete the following information):

  • Version 3.2

polyglot issue

@gingerbeardman
Copy link
Collaborator

gingerbeardman commented Jan 20, 2021

I'm not able to reproduce

using https://ar.wikipedia.org/wiki/بدر_البوسعيدي as a test

@StanleyKnife
Copy link
Author

Sorry - the site is fm.gov.om and I'm finding this issue each time I turn Polyglot back on. My co-workers are finding the same issue.

@StanleyKnife
Copy link
Author

StanleyKnife commented Jan 21, 2021

OK this is really odd. I've found that when I translated some text while editing the page (and thanks for that new ability, by the way) the following code was inserted in the panel I was editing:

image

@gingerbeardman
Copy link
Collaborator

that's the problem!

What type of edit control is the page using?

@StanleyKnife
Copy link
Author

It's the Avada theme, which has its own editing environment.

Previously Polyglot was unable to translate Arabic text within the editor window, so it wasn't an issue. I think I should just remember not to use it here.

By the way, Polyglot is a fantastic tool. Exactly what I need. Thank you!

@gingerbeardman
Copy link
Collaborator

I have also had Polyglot leaving text inside of text fields after selecting text in text field. I was editing an item on archive.org at the time.

@StanleyKnife
Copy link
Author

StanleyKnife commented Feb 12, 2021 via email

@gingerbeardman
Copy link
Collaborator

gingerbeardman commented Feb 13, 2021

I thought that in #28 translation was disabled in text field? @uetchy

because it's most likely the words in there are either in your own language, or words I am typing myself!

@StanleyKnife
Copy link
Author

StanleyKnife commented Feb 13, 2021 via email

@gingerbeardman
Copy link
Collaborator

gingerbeardman commented Mar 18, 2021

I am getting this in every text area:

  • Wordpress
  • Wikipedia
  • Internet Archive

It's very disruptive because I have to check and delete the stray html

@uetchy
Copy link
Owner

uetchy commented Mar 18, 2021

Actually I couldn't reproduce this bug. Could you give me a complete and precise procedure to reproduce the bug?

@gingerbeardman
Copy link
Collaborator

gingerbeardman commented Mar 18, 2021

Sure!

it is too easy to lose control of the popup and for its HTML to be saved with the contents of the text area.

Screen recording:

Setup:

  1. goto https://archive.org/create/
  2. click: Upload Files
  3. select a local file to upload (we're not actually going to upload it)
  4. click: description field
  5. type some description
  6. select the text you have just typed

Problems:

  1. spinner never goes away
  2. multiple popups
  3. top left popup is not under your direct control

Screen shot 2021-03-18 at 10 15 58

Next, without dismissing the popup:

  1. click into another field, eg. Subject tags
  2. click back into Description field
  3. choose <> button (html code view)

Problem:

  1. the code for the popup remains in the text field
  2. clicking on the text field will remove the old popup code

Screen shot 2021-03-18 at 10 29 09

@gingerbeardman
Copy link
Collaborator

gingerbeardman commented Mar 18, 2021

Similarly, with WordPress:

Screen shot 2021-03-18 at 10 43 27

I do not have time to show Wikipedia, but the process is the same.

Basically

  • do something on the page to change DOM before popup is dismissed and we lose control of the popup and its HTML code
  • popup HTML should not be added to text area

@uetchy
Copy link
Owner

uetchy commented Mar 19, 2021

Screen Shot 2021-03-19 at 5 42 17 PM

I can confirm.
That's a bit tricky problem.
Normally Polyglot can suppress instant translation when the selected text is in a textarea or input tag, but in this case the editor is just a body inside iframe that Polyglot cannot tell it's an editable text.

@uetchy
Copy link
Owner

uetchy commented Mar 19, 2021

Disabling handling iframe is the easiest route, but I don't want to do it because it also prevents me from translating live chat comments on YouTube. We need to find another solution to this.

@gingerbeardman
Copy link
Collaborator

I'll also think about this problem.

@gingerbeardman
Copy link
Collaborator

gingerbeardman commented Mar 19, 2021

Just to make some notes on possible exclusion list of selectors:

  • Internet Archive: div.wysiwyg iframe
  • WordPress: div.mce-tinymce
  • Wikipedia: div.ve-ce-surface

An option to disable in iframe could be possible? Or only disable iframe on certain sites? This would only fix Internet Archive.

Could the popup be created at top level of DOM? Immediately after body tag, and then positioned absolutely? Just thinking out loud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants