New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 612973 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Suppress Translate Prompts when in Airplane Mode

Project Member Reported by ainslie@chromium.org, May 18 2016

Issue description

Assist features (like translate) shouldn't prompt when we know the device is offline. 

I noticed this while testing net errors - does the translate prompt show up because CLD2 looked at the URL/path?

It's especially weird because the content area is in English and the translation won't work because I'm offline :/ 


 
Screenshot_20160518-144700.png
131 KB View Download

Comment 1 by groby@chromium.org, May 19 2016

Please do paste the actual URL so we can look at language detection logs. (There's no way I'll be able to type that URL by hand :)


lol. sure thing:
https://namu.wiki/w/나무위키:대문

I found it from the cookbook for them-color toolbars :) 

Comment 3 by groby@chromium.org, May 19 2016

Huh. We get no entry in the detection logs whatsoever. That probably means old and ugly state is still running around....

This is further supported that it only happens if I navigate to the page with network on, and then again when it's off. If I start Chrome w/ network off, I do not get a translate prompt. That means likely this was an in-page navigation.

Did you just refresh the URL, or did you navigate freshly?

Comment 4 by groby@chromium.org, May 19 2016

Owner: groby@chromium.org
Status: Started (was: Untriaged)
Also: The correct fix here is probably to check net::NetworkChangeNotifier::IsOffline in TranslateManager::InitiateTranslation and early-out when things are offline.

I'd do that right at the top of InitiateTranslation, without recording any metrics - it's the equivalent of never requesting a translation.
re: #3 
Yup. It was open in a tab, I turned on airplane mode, and then reloaded that tab. 
Project Member

Comment 7 by bugdroid1@chromium.org, May 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0e7f1247be559c523607aa1452dfd2a351b85173

commit 0e7f1247be559c523607aa1452dfd2a351b85173
Author: groby <groby@chromium.org>
Date: Mon May 30 05:47:14 2016

[Translate] Don't try to translate when offline

If the user reloads a page during a network outage, and language
detection for this page has completed before, Chrome will currently
offer to translate that page, even though this cannot possibly succeed
when offline.

This CL adds an early-out for any attempts to translate content while
offline.

TEST=Load https://namu.wiki/w/나무위키:대문 - then turn off network. Hit reload. Observe translate is not offered a second time.

BUG= 612973 

Review-Url: https://codereview.chromium.org/1997573002
Cr-Commit-Position: refs/heads/master@{#396683}

[modify] https://crrev.com/0e7f1247be559c523607aa1452dfd2a351b85173/components/translate/core/browser/translate_manager.cc
[modify] https://crrev.com/0e7f1247be559c523607aa1452dfd2a351b85173/components/translate/core/browser/translate_manager_unittest.cc

Comment 8 by groby@chromium.org, Sep 14 2016

Status: Fixed (was: Started)
Components: -UI>Browser>Translate UI>Browser>Language>Translate

Sign in to add a comment