Bug 1081296 - Add sumo link for promotional translation doorhanger. r=florian, a=lmandel
authorFelipe Gomes <felipc@gmail.com>
Fri, 10 Oct 2014 17:37:51 -0300
changeset 225671 fc59036ff930a674eb41dea5216f498e1e880aa5
parent 225670 e96a7a4f3bbea42c4022ff76e1da9e2fd93d90d9
child 225672 b82fa46ca35ae46d9eddf625c35adcd016789508
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, lmandel
bugs1081296
milestone34.0a2
Bug 1081296 - Add sumo link for promotional translation doorhanger. r=florian, a=lmandel
browser/components/translation/translation-infobar.xml
--- a/browser/components/translation/translation-infobar.xml
+++ b/browser/components/translation/translation-infobar.xml
@@ -26,17 +26,18 @@
           <xul:panel anonid="welcomePanel" class="translation-welcome-panel"
                      type="arrow" align="start">
             <xul:image class="translation-welcome-logo"/>
             <xul:vbox flex="1" class="translation-welcome-content">
               <xul:description class="translation-welcome-headline"
                                anonid="welcomeHeadline"/>
               <xul:description class="translation-welcome-body" anonid="welcomeBody"/>
               <xul:hbox align="center">
-                <xul:label anonid="learnMore" class="plain text-link"/>
+                <xul:label anonid="learnMore" class="plain text-link"
+                           onclick="openUILinkIn('https://support.mozilla.org/kb/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/>
                 <xul:spacer flex="1"/>
                 <xul:button class="translate-infobar-element" anonid="thanksButton"
                             onclick="this.parentNode.parentNode.parentNode.hidePopup();"/>
               </xul:hbox>
             </xul:vbox>
           </xul:panel>
           <xul:deck anonid="translationStates" selectedIndex="0">
 
@@ -210,17 +211,18 @@
 
             if (aTranslation.translatedTo)
               toLanguage.value = aTranslation.translatedTo;
 
             if (aTranslation.state)
               this.state = aTranslation.state;
 
             const kWelcomePref = "browser.translation.ui.welcomeMessageShown";
-            if (Services.prefs.prefHasUserValue(kWelcomePref))
+            if (Services.prefs.prefHasUserValue(kWelcomePref) ||
+                this.translation.browser != gBrowser.selectedBrowser)
               return;
 
             this.addEventListener("transitionend", function onShown() {
               this.removeEventListener("transitionend", onShown);
 
               // These strings are hardcoded because they need to reach beta
               // without riding the trains.
               let localizedStrings = {