forked from GrapheneOS/Vanadium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0039-remove-translate-offer-preference.patch
97 lines (89 loc) · 6.3 KB
/
0039-remove-translate-offer-preference.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From bc65236a76525314a7f532477b945af1ea9e3ee5 Mon Sep 17 00:00:00 2001
From: Daniel Micay <[email protected]>
Date: Fri, 2 Aug 2019 21:11:17 -0400
Subject: [PATCH 39/48] remove translate offer preference
---
.../java/res/xml/languages_preferences.xml | 8 ++---
.../languages/LanguagesPreferences.java | 36 +++++++++----------
.../java/strings/android_chrome_strings.grd | 6 ++--
3 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/chrome/android/java/res/xml/languages_preferences.xml b/chrome/android/java/res/xml/languages_preferences.xml
index 8d62f755e820..0d727947b67c 100644
--- a/chrome/android/java/res/xml/languages_preferences.xml
+++ b/chrome/android/java/res/xml/languages_preferences.xml
@@ -11,9 +11,9 @@
android:layout="@layout/languages_preference"
android:widgetLayout="@layout/accept_languages_list" />
- <org.chromium.chrome.browser.preferences.ChromeSwitchPreferenceCompat
- android:key="translate_switch"
- android:summaryOn="@string/languages_offer_translate_switch"
- android:summaryOff="@string/languages_offer_translate_switch" />
+ <!--<org.chromium.chrome.browser.preferences.ChromeSwitchPreferenceCompat-->
+ <!--android:key="translate_switch"-->
+ <!--android:summaryOn="@string/languages_offer_translate_switch"-->
+ <!--android:summaryOff="@string/languages_offer_translate_switch" />-->
</android.support.v7.preference.PreferenceScreen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java
index 26fe204c5367..d09cc4b0f855 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java
@@ -36,25 +36,25 @@ public class LanguagesPreferences
(LanguageListPreference) findPreference(PREFERRED_LANGUAGES_KEY);
mLanguageListPref.registerActivityLauncher(this);
- ChromeSwitchPreferenceCompat translateSwitch =
- (ChromeSwitchPreferenceCompat) findPreference(TRANSLATE_SWITCH_KEY);
- boolean isTranslateEnabled = PrefServiceBridge.getInstance().isTranslateEnabled();
- translateSwitch.setChecked(isTranslateEnabled);
+ //ChromeSwitchPreferenceCompat translateSwitch =
+ //(ChromeSwitchPreferenceCompat) findPreference(TRANSLATE_SWITCH_KEY);
+ //boolean isTranslateEnabled = PrefServiceBridge.getInstance().isTranslateEnabled();
+ //translateSwitch.setChecked(isTranslateEnabled);
- translateSwitch.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- boolean enabled = (boolean) newValue;
- PrefServiceBridge.getInstance().setTranslateEnabled(enabled);
- LanguagesManager.recordAction(enabled ? LanguagesManager.LanguageSettingsActionType
- .ENABLE_TRANSLATE_GLOBALLY
- : LanguagesManager.LanguageSettingsActionType
- .DISABLE_TRANSLATE_GLOBALLY);
- return true;
- }
- });
- translateSwitch.setManagedPreferenceDelegate(
- preference -> PrefServiceBridge.getInstance().isTranslateManaged());
+ //translateSwitch.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ //@Override
+ //public boolean onPreferenceChange(Preference preference, Object newValue) {
+ //boolean enabled = (boolean) newValue;
+ //PrefServiceBridge.getInstance().setTranslateEnabled(enabled);
+ //LanguagesManager.recordAction(enabled ? LanguagesManager.LanguageSettingsActionType
+ //.ENABLE_TRANSLATE_GLOBALLY
+ //: LanguagesManager.LanguageSettingsActionType
+ //.DISABLE_TRANSLATE_GLOBALLY);
+ //return true;
+ //}
+ //});
+ //translateSwitch.setManagedPreferenceDelegate(
+ //preference -> PrefServiceBridge.getInstance().isTranslateManaged());
LanguagesManager.recordImpression(LanguagesManager.LanguageSettingsPageType.PAGE_MAIN);
}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
index 9081f46eee2a..a849a9512258 100644
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -1181,9 +1181,9 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_LANGUAGES_LIST_PREFS_DESCRIPTION" desc="Description on the Languages settings screen. Appears above a list of one or more languages that the user selects, to tell Vanadium which languages they prefer to use to read website content.">
Websites will show text in your preferred language, when possible.
</message>
- <message name="IDS_LANGUAGES_OFFER_TRANSLATE_SWITCH" desc="Appears next to the 'offer to translate' switch that controls whether or not Vanadium will display the Google Translate UI on web pages that are not in the user's preferred language(s).">
- Offer to translate pages in other languages
- </message>
+ <!--<message name="IDS_LANGUAGES_OFFER_TRANSLATE_SWITCH" desc="Appears next to the 'offer to translate' switch that controls whether or not Vanadium will display the Google Translate UI on web pages that are not in the user's preferred language(s).">-->
+ <!--Offer to translate pages in other languages-->
+ <!--</message>-->
<message name="IDS_LANGUAGES_ITEM_OPTION_OFFER_TO_TRANSLATE" desc="Option in language item menu. User can click the 'Offer to translate' option to toggle whether they want Vanadium to translate pages in this language. [CHAR-LIMIT=32]">
Offer to translate
</message>
--
2.23.0