Skip to content

Commit

Permalink
i18n disable google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Oct 19, 2016
1 parent 9f12079 commit 0b0af8f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions src/popup/app/settings/settingsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
i18nService) {
var gaKey = 'disableGa';

utilsService.initListSectionItemListeners($(document), angular);
$scope.disableGa = false;
$scope.i18n = i18nService;

Expand Down Expand Up @@ -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');
}
});
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/popup/app/settings/views/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
<div class="list-section-items">
<div class="list-section-item list-section-item-checkbox">
<label for="ga">Disable Google Analytics</label>
<label for="ga">{{i18n.disableGa}}</label>
<input id="ga" type="checkbox" ng-model="disableGa" ng-change="updateGa()">
</div>
<a class="list-section-item" ui-sref="about({animation: 'in-slide-left'})">
Expand Down
1 change: 1 addition & 0 deletions src/services/i18nService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 0b0af8f

Please sign in to comment.