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

MTW is not translating #62

Open
rohankatyal29 opened this issue Mar 4, 2016 · 10 comments
Open

MTW is not translating #62

rohankatyal29 opened this issue Mar 4, 2016 · 10 comments

Comments

@rohankatyal29
Copy link
Contributor

I can't seem to get MTW to translate. I am using yandex for the translations.
Here are the relevant screenshots:

screen shot 2016-03-04 at 12 38 59 pm

screen shot 2016-03-04 at 12 38 54 pm

screen shot 2016-03-04 at 12 38 31 pm

screen shot 2016-03-04 at 12 38 22 pm

@ceilican
Copy link
Contributor

ceilican commented Mar 4, 2016

You must must select the translation configuration that you want to use. Your third screenshot shows that you selected "do not trans" late.That is why it is not translating.

@ceilican ceilican closed this as completed Mar 4, 2016
@ceilican
Copy link
Contributor

ceilican commented Mar 4, 2016

Anyway, the GUI could be improved to make it clear that a selection must be made.

@rohankatyal29
Copy link
Contributor Author

@ceilican: I have activated the translation, but I still can't see any change on the page
screen shot 2016-03-05 at 9 16 07 am
screen shot 2016-03-05 at 9 15 55 am
screen shot 2016-03-05 at 9 15 38 am

@ceilican ceilican reopened this Mar 7, 2016
@ceilican
Copy link
Contributor

ceilican commented Mar 7, 2016

The latest stable version from the Chrome Web Store works for me.

screen shot 2016-03-07 at 17 00 54
screen shot 2016-03-07 at 17 01 43

@ceilican
Copy link
Contributor

ceilican commented Mar 7, 2016

I won't have time to investigate this issue deeply now.

Note that, if the page is long, MTW takes a long time to display the translations.

@alexklibisz
Copy link
Contributor

I've noticed this as an inconsistency between sites. For example, Wikipedia appears to work fine with a Yandex key, but Hacker News (news.ycombinator.com) does not.

Working on Wikipedia: http://i.imgur.com/5W14c8i.gif
Non-working on Hacker News: http://i.imgur.com/lkb2Wyj.gif

I started debugging by looking at the function requestTranslations on line 21 in MindTheWord.js. After some debugging, it looks like Hacker News takes about 10 seconds to hit that line, and when it does, the sourceWords object is empty. In the image below I've added a debugger statement on line 24 in MindTheWord.js. Notice the console statements showing that sourceWords is empty:

image

I'm a potential GSOC student, so I'm going to take some time now to look at the GSOC puzzles before moving back to this issue, but hopefully this information can get someone moving in the right direction.

@ankit-m
Copy link
Contributor

ankit-m commented Mar 14, 2016

@alexklibisz The source words are empty because there are no <p> tags in the hacker news page. If you look at line 217 of MindTheWord.js you'll see that getAllWords() is searching by p tags.

ptags

On the other hand, if you see the comments page of YC, you will see translations
ycpage

But we can definitely look for other ways to implement it.

@ankit-m
Copy link
Contributor

ankit-m commented Mar 14, 2016

A quick search got me this. You can get all the text in a document with the following code

var body = document.body;
var textContent = body.textContent || body.innerText;
console.log(textContent); 

I tested it now, it does work. But speed is still an issue.

@alexklibisz
Copy link
Contributor

@ankit-m I noticed that only p tags are considered from another issue I worked on just now. Good catch. Is this a considerable speed issue? Is it taking noticeably longer to handle?

@ceilican
Copy link
Contributor

@ankit-m @rohankatyal29, Was this issue solved?

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

No branches or pull requests

4 participants