From 0b0af8f7557ccf3ff983703194f7aee455c2cef2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 18 Oct 2016 20:19:17 -0400 Subject: [PATCH] i18n disable google analytics --- src/_locales/en/messages.json | 4 ++++ src/popup/app/settings/settingsController.js | 5 +++++ src/popup/app/settings/views/settings.html | 2 +- src/services/i18nService.js | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index e5290ea8202a..6fe551e5136e 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -367,6 +367,10 @@ "message": "Other", "description": "Other" }, + "disableGa": { + "message": "Disable Google Analytics", + "description": "Disable Google Analytics" + }, "rateExtension": { "message": "Rate the Extension", "description": "Rate the Extension" diff --git a/src/popup/app/settings/settingsController.js b/src/popup/app/settings/settingsController.js index 7e4778cd535f..bde39604e4d3 100644 --- a/src/popup/app/settings/settingsController.js +++ b/src/popup/app/settings/settingsController.js @@ -5,6 +5,7 @@ i18nService) { var gaKey = 'disableGa'; + utilsService.initListSectionItemListeners($(document), angular); $scope.disableGa = false; $scope.i18n = i18nService; @@ -88,11 +89,15 @@ } else { // disable + $analytics.eventTrack('Disabled Google Analytics'); obj[gaKey] = true; } chrome.storage.local.set(obj, function () { $scope.disableGa = obj[gaKey]; + if (!obj[gaKey]) { + $analytics.eventTrack('Enabled Google Analytics'); + } }); }); }; diff --git a/src/popup/app/settings/views/settings.html b/src/popup/app/settings/views/settings.html index fe83c92e4691..948cb0e372ed 100644 --- a/src/popup/app/settings/views/settings.html +++ b/src/popup/app/settings/views/settings.html @@ -46,7 +46,7 @@
- +
diff --git a/src/services/i18nService.js b/src/services/i18nService.js index 9b35bda88ae1..5d0bcd1adb97 100644 --- a/src/services/i18nService.js +++ b/src/services/i18nService.js @@ -88,6 +88,7 @@ function i18nService() { togglePassword: chrome.i18n.getMessage('togglePassword'), manage: chrome.i18n.getMessage('manage'), other: chrome.i18n.getMessage('other'), + disableGa: chrome.i18n.getMessage('disableGa'), rateExtension: chrome.i18n.getMessage('rateExtension'), rateExtensionDesc: chrome.i18n.getMessage('rateExtensionDesc'), browserNotSupportClipboard: chrome.i18n.getMessage('browserNotSupportClipboard')