Skip to content

Commit

Permalink
Fix localization and telemetry
Browse files Browse the repository at this point in the history
This fixes localization[1], addresses the additional comments about
telemetry pings in [2] and increments the version number.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1291634
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1284652
  • Loading branch information
sapohl committed Aug 4, 2016
1 parent f907bde commit e052a55
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 11 deletions.
23 changes: 13 additions & 10 deletions addon/outofdate-notifications@mozilla.org/bootstrap.js
Expand Up @@ -29,13 +29,18 @@ const KNOWN_DISTROS = ["1und1",
"yandex",
"yahoo"];

let gPingPayload = { shown: false, clicked: false };
let gPingTypes = [{ payload: { event: "started" }, sent: false },
{ payload: { event: "shown" }, sent: false },
{ payload: { event: "clicked" }, sent: false }];
let gIsPartnerRepack = false;

function sendPing() {
TelemetryController.submitExternalPing(
"outofdate-notifications-system-addon", gPingPayload,
{ addClientId: true });
function sendPing(aPingIndex) {
if (!gPingTypes[aPingIndex].sent) {
TelemetryController.submitExternalPing(
"outofdate-notifications-system-addon", gPingTypes[aPingIndex].payload,
{ addClientId: true });
gPingTypes[aPingIndex].sent = true;
}
}

function startup() {
Expand All @@ -60,7 +65,7 @@ function startup() {
// Load into any new windows
wm.addListener(windowListener);

sendPing();
sendPing(0);
}

function showDoorhanger(aWindow) {
Expand All @@ -73,8 +78,7 @@ function showDoorhanger(aWindow) {
label: gStringBundle.GetStringFromName("buttonlabel"),
accessKey: gStringBundle.GetStringFromName("buttonaccesskey"),
callback: function () {
gPingPayload.clicked = true;
sendPing();
sendPing(2);

let url = Preferences.get(PREF_UPDATE_URL, PREF_UPDATE_DEFAULT_URL);
aWindow.openUILinkIn(url, "tab");
Expand All @@ -93,8 +97,7 @@ function showDoorhanger(aWindow) {
notification, "class", "messageCloseButton close-icon tabbable");
closeButton.hidden = true;

gPingPayload.shown = true;
sendPing();
sendPing(1);
}

function loadIntoWindow(aWindow) {
Expand Down
48 changes: 48 additions & 0 deletions addon/outofdate-notifications@mozilla.org/chrome.manifest
@@ -1 +1,49 @@
locale outofdate-notifications en-US locales/en-US/
locale outofdate-notifications ar locales/ar/
locale outofdate-notifications ast locales/ast/
locale outofdate-notifications az locales/az/
locale outofdate-notifications bg locales/bg/
locale outofdate-notifications bn-BD locales/bn-BD/
locale outofdate-notifications cs locales/cs/
locale outofdate-notifications cy locales/cy/
locale outofdate-notifications da locales/da/
locale outofdate-notifications de locales/de/
locale outofdate-notifications dsb locales/dsb/
locale outofdate-notifications el locales/el/
locale outofdate-notifications en-GB locales/en-GB/
locale outofdate-notifications es-AR locales/es-AR/
locale outofdate-notifications es-CL locales/es-CL/
locale outofdate-notifications es-ES locales/es-ES/
locale outofdate-notifications es-MX locales/es-MX/
locale outofdate-notifications et locales/et/
locale outofdate-notifications fi locales/fi/
locale outofdate-notifications fr locales/fr/
locale outofdate-notifications fy-NL locales/fy-NL/
locale outofdate-notifications he locales/he/
locale outofdate-notifications hr locales/hr/
locale outofdate-notifications hsb locales/hsb/
locale outofdate-notifications hu locales/hu/
locale outofdate-notifications id locales/id/
locale outofdate-notifications it locales/it/
locale outofdate-notifications ja locales/ja/
locale outofdate-notifications kk locales/kk/
locale outofdate-notifications ko locales/ko/
locale outofdate-notifications lv locales/lv/
locale outofdate-notifications nl locales/nl/
locale outofdate-notifications nn-NO locales/nn-NO/
locale outofdate-notifications pa-IN locales/pa-IN/
locale outofdate-notifications pl locales/pl/
locale outofdate-notifications pt-BR locales/pt-BR/
locale outofdate-notifications pt-PT locales/pt-PT/
locale outofdate-notifications ru locales/ru/
locale outofdate-notifications sk locales/sk/
locale outofdate-notifications sl locales/sl/
locale outofdate-notifications sq locales/sq/
locale outofdate-notifications sr locales/sr/
locale outofdate-notifications sv-SE locales/sv-SE/
locale outofdate-notifications te locales/te/
locale outofdate-notifications tr locales/tr/
locale outofdate-notifications uk locales/uk/
locale outofdate-notifications uz locales/uz/
locale outofdate-notifications zh-CN locales/zh-CN/
locale outofdate-notifications zh-TW locales/zh-TW/
2 changes: 1 addition & 1 deletion addon/outofdate-notifications@mozilla.org/install.rdf
Expand Up @@ -9,7 +9,7 @@

<Description about="urn:mozilla:install-manifest">
<em:id>outofdate-notifications@mozilla.org</em:id>
<em:version>1.2</em:version>
<em:version>1.3</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>

Expand Down

0 comments on commit e052a55

Please sign in to comment.