mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1013861
: add pref to control showing the translation UI. r=felipe
This commit is contained in:
parent
d879c7b93f
commit
26f2ac1137
@ -1568,6 +1568,8 @@ pref("browser.cache.frecency_experiment", 0);
|
||||
|
||||
pref("browser.translation.detectLanguage", false);
|
||||
pref("browser.translation.neverForLanguages", "");
|
||||
// Show the translation UI bits, like the info bar, notification icon and preferences.
|
||||
pref("browser.translation.ui.show", false);
|
||||
|
||||
// Telemetry experiments settings.
|
||||
pref("experiments.enabled", true);
|
||||
|
@ -8,6 +8,8 @@ this.EXPORTED_SYMBOLS = ["Translation"];
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
const TRANSLATION_PREF_SHOWUI = "browser.translation.ui.show";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
this.Translation = {
|
||||
@ -26,6 +28,9 @@ this.Translation = {
|
||||
},
|
||||
|
||||
languageDetected: function(aBrowser, aDetectedLanguage) {
|
||||
if (!Services.prefs.getBoolPref(TRANSLATION_PREF_SHOWUI))
|
||||
return;
|
||||
|
||||
if (this.supportedSourceLanguages.indexOf(aDetectedLanguage) != -1 &&
|
||||
aDetectedLanguage != this.defaultTargetLanguage) {
|
||||
if (!aBrowser.translationUI)
|
||||
|
Loading…
Reference in New Issue
Block a user