From 424f13178a2c830c764874aa3d7ff347053e8cd6 Mon Sep 17 00:00:00 2001 From: AlexVallat Date: Wed, 29 Apr 2015 18:45:11 +0100 Subject: [PATCH] Change net monitor menu label to be independent, and to be "Block Resource" --- platform/firefox/vapi-background.js | 6 +++--- src/_locales/en/messages.json | 4 ++++ tools/make-firefox-meta.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index a72ed7631..f90849fe7 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1944,10 +1944,10 @@ vAPI.contextMenu.displayMenuItem = function({target}) { /******************************************************************************/ -vAPI.contextMenu.createContextMenuItem = function(doc) { +vAPI.contextMenu.createContextMenuItem = function(doc, labelOverride) { var menuitem = doc.createElement('menuitem'); menuitem.setAttribute('id', this.menuItemId); - menuitem.setAttribute('label', this.menuLabel); + menuitem.setAttribute('label', labelOverride || this.menuLabel); menuitem.setAttribute('image', vAPI.getURL('img/browsericons/icon16.svg')); menuitem.setAttribute('class', 'menuitem-iconic'); return menuitem; @@ -2038,7 +2038,7 @@ vAPI.contextMenu.registerForNetMonitor = function(eventName, toolbox, panel) { var insertBeforeMenuItem = doc.getElementById("request-menu-context-separator"); if (menuPopup && insertBeforeMenuItem) { - var menuitem = vAPI.contextMenu.createContextMenuItem(doc); + var menuitem = vAPI.contextMenu.createContextMenuItem(doc, vAPI.i18n('netMonitorContextMenuEntry')); menuitem.addEventListener('command', function() { var selectedRequest = panel.panelWin.NetMonitorView.RequestsMenu.selectedAttachment; if (selectedRequest) { diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 80d48550a..2a3dc8bbd 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -147,6 +147,10 @@ "message":"Block element", "description":"English: Block element" }, + "netMonitorContextMenuEntry":{ + "message":"Block resource", + "description":"English: Block resource" + }, "settingsCollapseBlockedPrompt":{ "message":"Hide placeholders of blocked elements", "description":"English: Hide placeholders of blocked elements" diff --git a/tools/make-firefox-meta.py b/tools/make-firefox-meta.py index f8ec3ed2b..0401eddfc 100644 --- a/tools/make-firefox-meta.py +++ b/tools/make-firefox-meta.py @@ -24,7 +24,7 @@ source_locale_dir = pj(build_dir, '_locales') target_locale_dir = pj(build_dir, 'locale') language_codes = [] descriptions = OrderedDict({}) -title_case_strings = ['pickerContextMenuEntry'] +title_case_strings = ['pickerContextMenuEntry', 'netMonitorContextMenuEntry'] for alpha2 in sorted(os.listdir(source_locale_dir)): locale_path = pj(source_locale_dir, alpha2, 'messages.json')