New issue
Advanced search Search tips

Issue 774004 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

indonesia content is detected as English in WebApk

Project Member Reported by goog...@chromium.org, Oct 12 2017

Issue description

Chrome Version: M61
OS: Android

What steps will reproduce the problem?
(1) Launch 
https://babe.news/read/108422568/eggi-sudjana-ancam-lakukan-ini-jika-pemuda-hindu-tak-cabut-laporan
(2) Set it as WPA mode. Menu > Add to home Screen
(3) Launch page in WebAPK mode

What is the expected result?
Translate infobar pops up.

What happens instead?
Translate infobar didn't pops up.

Please use labels and text to provide additional information.

Debugged and found the page in WebApk mode is detected as "en" language but It's detected as "id" in Chrome.

 
Status: Fixed (was: Untriaged)
I think I figured out the root cause for it. It's a little complicated due to multi factors.

First and the most important reason is that the website home page is mostly AJAX. So the initial content (invisible for end user) loaded in the beginning is detected as English in language_detection(translate/core/language_detection/language_detection_util.cc) and translate service is not triggered. 

Then the home page content is loaded by ajax, but it will not trigger language detection anymore. So even the page content is filled with Indonesia text, there is no translate infobar.

And when you click a link to a news page, the page content is still loaded by Ajax too, so the language detection is still not triggered.


Why translate infobar is showing for the url (https://babe.news/read/108422568/eggi-sudjana-ancam-lakukan-ini-jika-pemuda-hindu-tak-cabut-laporan) in Chrome but not for WebApk?
If the link is opened directly in Chrome, it will load news content in the initial load, language will be detected as 'ID', then translate infobar pops up. But for WebApk, news pages is always loaded from the home page instead of launching the URL directly.

So seems neither language detection nor WebApk is wrong. And it might be fixed by detecting text when DOM tree is changed, but it will introduce more other complexities which is not in scope of this discussion.



Sign in to add a comment