Commit 3dab2a4e authored by Lorne Mitchell's avatar Lorne Mitchell Committed by Commit Bot

DevTools: Localize resource types in the Network tool

The resource types weren't localizable. This change fixes this by calling ls`` on each resource type in ResourceType.js. In addition, the tooltips for the record and search buttons. These were already localizable, but the module title descriptor wasn't running through ls().

Bug: 941561
Change-Id: I1d2a035bd2f763597458ab463c4343edc8a9337c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1791440Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Reviewed-by: default avatarJeff Fisher <jeffish@microsoft.com>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#702480}
parent bf577cf0
...@@ -235,16 +235,16 @@ export class ResourceCategory { ...@@ -235,16 +235,16 @@ export class ResourceCategory {
* @enum {!ResourceCategory} * @enum {!ResourceCategory}
*/ */
export const resourceCategories = { export const resourceCategories = {
XHR: new ResourceCategory('XHR and Fetch', 'XHR'), XHR: new ResourceCategory(ls`XHR and Fetch`, ls`XHR`),
Script: new ResourceCategory('Scripts', 'JS'), Script: new ResourceCategory(ls`Scripts`, ls`JS`),
Stylesheet: new ResourceCategory('Stylesheets', 'CSS'), Stylesheet: new ResourceCategory(ls`Stylesheets`, ls`CSS`),
Image: new ResourceCategory('Images', 'Img'), Image: new ResourceCategory(ls`Images`, ls`Img`),
Media: new ResourceCategory('Media', 'Media'), Media: new ResourceCategory(ls`Media`, ls`Media`),
Font: new ResourceCategory('Fonts', 'Font'), Font: new ResourceCategory(ls`Fonts`, ls`Font`),
Document: new ResourceCategory('Documents', 'Doc'), Document: new ResourceCategory(ls`Documents`, ls`Doc`),
WebSocket: new ResourceCategory('WebSockets', 'WS'), WebSocket: new ResourceCategory(ls`WebSockets`, ls`WS`),
Manifest: new ResourceCategory('Manifest', 'Manifest'), Manifest: new ResourceCategory(ls`Manifest`, ls`Manifest`),
Other: new ResourceCategory('Other', 'Other') Other: new ResourceCategory(ls`Other`, ls`Other`)
}; };
/** /**
...@@ -252,22 +252,22 @@ export const resourceCategories = { ...@@ -252,22 +252,22 @@ export const resourceCategories = {
* @enum {!ResourceType} * @enum {!ResourceType}
*/ */
export const resourceTypes = { export const resourceTypes = {
XHR: new ResourceType('xhr', 'XHR', resourceCategories.XHR, true), XHR: new ResourceType('xhr', ls`XHR`, resourceCategories.XHR, true),
Fetch: new ResourceType('fetch', 'Fetch', resourceCategories.XHR, true), Fetch: new ResourceType('fetch', ls`Fetch`, resourceCategories.XHR, true),
EventSource: new ResourceType('eventsource', 'EventSource', resourceCategories.XHR, true), EventSource: new ResourceType('eventsource', ls`EventSource`, resourceCategories.XHR, true),
Script: new ResourceType('script', 'Script', resourceCategories.Script, true), Script: new ResourceType('script', ls`Script`, resourceCategories.Script, true),
Stylesheet: new ResourceType('stylesheet', 'Stylesheet', resourceCategories.Stylesheet, true), Stylesheet: new ResourceType('stylesheet', ls`Stylesheet`, resourceCategories.Stylesheet, true),
Image: new ResourceType('image', 'Image', resourceCategories.Image, false), Image: new ResourceType('image', ls`Image`, resourceCategories.Image, false),
Media: new ResourceType('media', 'Media', resourceCategories.Media, false), Media: new ResourceType('media', ls`Media`, resourceCategories.Media, false),
Font: new ResourceType('font', 'Font', resourceCategories.Font, false), Font: new ResourceType('font', ls`Font`, resourceCategories.Font, false),
Document: new ResourceType('document', 'Document', resourceCategories.Document, true), Document: new ResourceType('document', ls`Document`, resourceCategories.Document, true),
TextTrack: new ResourceType('texttrack', 'TextTrack', resourceCategories.Other, true), TextTrack: new ResourceType('texttrack', ls`TextTrack`, resourceCategories.Other, true),
WebSocket: new ResourceType('websocket', 'WebSocket', resourceCategories.WebSocket, false), WebSocket: new ResourceType('websocket', ls`WebSocket`, resourceCategories.WebSocket, false),
Other: new ResourceType('other', 'Other', resourceCategories.Other, false), Other: new ResourceType('other', ls`Other`, resourceCategories.Other, false),
SourceMapScript: new ResourceType('sm-script', 'Script', resourceCategories.Script, true), SourceMapScript: new ResourceType('sm-script', ls`Script`, resourceCategories.Script, true),
SourceMapStyleSheet: new ResourceType('sm-stylesheet', 'Stylesheet', resourceCategories.Stylesheet, true), SourceMapStyleSheet: new ResourceType('sm-stylesheet', ls`Stylesheet`, resourceCategories.Stylesheet, true),
Manifest: new ResourceType('manifest', 'Manifest', resourceCategories.Manifest, true), Manifest: new ResourceType('manifest', ls`Manifest`, resourceCategories.Manifest, true),
SignedExchange: new ResourceType('signed-exchange', 'SignedExchange', resourceCategories.Other, false), SignedExchange: new ResourceType('signed-exchange', ls`SignedExchange`, resourceCategories.Other, false)
}; };
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import './EventTarget.js'; import './EventTarget.js';
import './Object.js'; import './Object.js';
import './UIString.js';
// Do not reorder these imports as it breaks dependencies. // Do not reorder these imports as it breaks dependencies.
......
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<message name="IDS_DEVTOOLS_0945359809dad1fbf3dea1c95a0da951" desc="Name of a network resource type">
Document
</message>
<message name="IDS_DEVTOOLS_21133d71a056222fa2096906538e4e04" desc="Text that appears on a button for the image resource type filter.">
Img
</message>
<message name="IDS_DEVTOOLS_375c9558f2166cab6515a7ab774c1735" desc="Name of a network resource type">
TextTrack
</message>
<message name="IDS_DEVTOOLS_441d3aea2e55865603a26ca972779831" desc="Text that appears in a tooltip the xhr and fetch resource types filter.">
XHR and Fetch
</message>
<message name="IDS_DEVTOOLS_45edc1b96407d9d213dd1135962a32a0" desc="Name of a network resource type">
WebSocket
</message>
<message name="IDS_DEVTOOLS_4ea7755f84f02d23876d90be2f9765cf" desc="Name of a network resource type">
Fetch
</message>
<message name="IDS_DEVTOOLS_54df3baef130c81e6ae8432a2567320a" desc="Text that appears on a button for the websocket resource type filter.">
WS
</message>
<message name="IDS_DEVTOOLS_59c4ad3f3cb3d812d68fab7a354d4a63" desc="Text that appears in a tooltip for the resource types filter.">
Fonts
</message>
<message name="IDS_DEVTOOLS_7a48ae1b7387f8a8159c488fbd850021" desc="Text that appears on a button for the document resource type filter.">
Doc
</message>
<message name="IDS_DEVTOOLS_85e8231d44b865e90f6a39b356ded9bd" desc="Text that appears in a tooltip for the css types filter.">
Stylesheets
</message>
<message name="IDS_DEVTOOLS_8cf6dd5e7b4fe7b6df3319b9803278f3" desc="Name of a network resource type">
EventSource
</message>
<message name="IDS_DEVTOOLS_a83f1ca5ad00b39773d9e6a26b0e70b2" desc="Text that appears in a tooltip for the javascript types filter.">
Scripts
</message>
<message name="IDS_DEVTOOLS_bef61d7d03206d267fdbab45fdca247d" desc="Name of a network resource type">
SignedExchange
</message>
<message name="IDS_DEVTOOLS_bf4e3c3f0fc3aee351d560e6e026f805" desc="Text that appears in a tooltip for the websocket types filter.">
WebSockets
</message>
<message name="IDS_DEVTOOLS_c350bb18c3cdfbd4e5444faa63be6586" desc="Name of a network resource type">
Stylesheet
</message>
<message name="IDS_DEVTOOLS_fff0d600f8a0b5e19e88bfb821dd1157" desc="Text that appears in a tooltip for the image types filter.">
Images
</message>
</grit-part>
\ No newline at end of file
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
"ContentProvider.js", "ContentProvider.js",
"ParsedURL.js", "ParsedURL.js",
"Progress.js", "Progress.js",
"UIString.js",
"ResourceType.js", "ResourceType.js",
"Settings.js", "Settings.js",
"StaticContentProvider.js", "StaticContentProvider.js",
"SegmentedRange.js", "SegmentedRange.js",
"Throttler.js", "Throttler.js",
"Trie.js", "Trie.js",
"UIString.js",
"Revealer.js", "Revealer.js",
"App.js", "App.js",
"AppProvider.js", "AppProvider.js",
......
...@@ -13,12 +13,6 @@ Click the reload button <ph name="RELOAD_BUTTON_ICON">$2s<ex>reload button icon< ...@@ -13,12 +13,6 @@ Click the reload button <ph name="RELOAD_BUTTON_ICON">$2s<ex>reload button icon<
<message name="IDS_DEVTOOLS_2adbfb69a37aa4a29ca846736d2111db" desc="Text in Coverage List View of the Coverage tab"> <message name="IDS_DEVTOOLS_2adbfb69a37aa4a29ca846736d2111db" desc="Text in Coverage List View of the Coverage tab">
JS (coarse) JS (coarse)
</message> </message>
<message name="IDS_DEVTOOLS_2c56c360580420d293172f42d85dfbed" desc="Text in Coverage List View of the Coverage tab">
CSS
</message>
<message name="IDS_DEVTOOLS_5bc06f5800d415cc95e1349edbaca425" desc="Text in Coverage List View of the Coverage tab">
JS
</message>
<message name="IDS_DEVTOOLS_73af525212a812236f1a3618e9cfa717" desc="Tooltip text that appears when hovering over the largeicon download button in the Coverage View of the Coverage tab"> <message name="IDS_DEVTOOLS_73af525212a812236f1a3618e9cfa717" desc="Tooltip text that appears when hovering over the largeicon download button in the Coverage View of the Coverage tab">
Export... Export...
</message> </message>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<part file="../browser_sdk/browser_sdk_strings.grdp" /> <part file="../browser_sdk/browser_sdk_strings.grdp" />
<part file="../changes/changes_strings.grdp" /> <part file="../changes/changes_strings.grdp" />
<part file="../color_picker/color_picker_strings.grdp" /> <part file="../color_picker/color_picker_strings.grdp" />
<part file="../common/common_strings.grdp" />
<part file="../components/components_strings.grdp" /> <part file="../components/components_strings.grdp" />
<part file="../console/console_strings.grdp" /> <part file="../console/console_strings.grdp" />
<part file="../console_counters/console_counters_strings.grdp" /> <part file="../console_counters/console_counters_strings.grdp" />
......
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
<message name="IDS_DEVTOOLS_193cfc9be3b995831c6af2fea6650e60" desc="Text that refers to one or a group of webpages"> <message name="IDS_DEVTOOLS_193cfc9be3b995831c6af2fea6650e60" desc="Text that refers to one or a group of webpages">
Page Page
</message> </message>
<message name="IDS_DEVTOOLS_194f5394ae2e9c74dc3c441b92862d1d" desc="Text that appears on a button for the font resource type filter.">
Font
</message>
<message name="IDS_DEVTOOLS_1c481aa99d081c32182011a758f73d33" desc="Text that only contain a placeholder"> <message name="IDS_DEVTOOLS_1c481aa99d081c32182011a758f73d33" desc="Text that only contain a placeholder">
<ph name="DURATIONTEXT">$1s<ex>100ms (at 200ms)</ex></ph> <ph name="DURATIONTEXT">$1s<ex>100ms (at 200ms)</ex></ph>
</message> </message>
...@@ -94,6 +97,9 @@ ...@@ -94,6 +97,9 @@
<message name="IDS_DEVTOOLS_2bbc845892f400626baab5af687527c5" desc="Text for the start time of an activity"> <message name="IDS_DEVTOOLS_2bbc845892f400626baab5af687527c5" desc="Text for the start time of an activity">
Start Time Start Time
</message> </message>
<message name="IDS_DEVTOOLS_2c56c360580420d293172f42d85dfbed" desc="Text that appears on a button for the css resource type filter.">
CSS
</message>
<message name="IDS_DEVTOOLS_2ce2fc341b0bd9219a3634ff43a90bde" desc="Generic text with two placeholders separated by a comma"> <message name="IDS_DEVTOOLS_2ce2fc341b0bd9219a3634ff43a90bde" desc="Generic text with two placeholders separated by a comma">
<ph name="ITEM_LABEL">$1s<ex>1 613 680</ex></ph>, <ph name="CHECKEDSTATE">$2s<ex>44 %</ex></ph> <ph name="ITEM_LABEL">$1s<ex>1 613 680</ex></ph>, <ph name="CHECKEDSTATE">$2s<ex>44 %</ex></ph>
</message> </message>
...@@ -121,6 +127,9 @@ ...@@ -121,6 +127,9 @@
<message name="IDS_DEVTOOLS_3afbd9828e011526955ca93b48b57524" desc="Text for one or a group of screenshots"> <message name="IDS_DEVTOOLS_3afbd9828e011526955ca93b48b57524" desc="Text for one or a group of screenshots">
Screenshot Screenshot
</message> </message>
<message name="IDS_DEVTOOLS_3b563524fdb17b4a86590470d40bef74" desc="Text that appears on a button for the media resource type filter.">
Media
</message>
<message name="IDS_DEVTOOLS_3bb3e8c8a24891ba0f7608bcc96f8b0a" desc="Text for a rendering frame"> <message name="IDS_DEVTOOLS_3bb3e8c8a24891ba0f7608bcc96f8b0a" desc="Text for a rendering frame">
Frame Frame
</message> </message>
...@@ -211,6 +220,9 @@ ...@@ -211,6 +220,9 @@
<message name="IDS_DEVTOOLS_5b6cf869265c13af8566f192b4ab3d2a" desc="Text for the documentation of something"> <message name="IDS_DEVTOOLS_5b6cf869265c13af8566f192b4ab3d2a" desc="Text for the documentation of something">
Documentation Documentation
</message> </message>
<message name="IDS_DEVTOOLS_5bc06f5800d415cc95e1349edbaca425" desc="Text that appears on a button for the javascript resource type filter.">
JS
</message>
<message name="IDS_DEVTOOLS_5de39fa1bce4bbf9232597a2120bc4d4" desc="Text to open the cubic bezier editor"> <message name="IDS_DEVTOOLS_5de39fa1bce4bbf9232597a2120bc4d4" desc="Text to open the cubic bezier editor">
Open cubic bezier editor. Open cubic bezier editor.
</message> </message>
...@@ -265,6 +277,9 @@ ...@@ -265,6 +277,9 @@
<message name="IDS_DEVTOOLS_74540c79e377bea903e1023a46df5574" desc="Text to open a file"> <message name="IDS_DEVTOOLS_74540c79e377bea903e1023a46df5574" desc="Text to open a file">
Open file Open file
</message> </message>
<message name="IDS_DEVTOOLS_76c3e002d3c052bd6a909366a8dc3845" desc="Text that appears on a button for the manifest resource type filter.">
Manifest
</message>
<message name="IDS_DEVTOOLS_787ae37366b7a8c53f381abfd315c647" desc="Text that refers to the Elements Panel"> <message name="IDS_DEVTOOLS_787ae37366b7a8c53f381abfd315c647" desc="Text that refers to the Elements Panel">
Elements Panel Elements Panel
</message> </message>
...@@ -454,6 +469,9 @@ ...@@ -454,6 +469,9 @@
<message name="IDS_DEVTOOLS_bccaa4aa80831b76c11240a16447975f" desc="Title of the Console tool"> <message name="IDS_DEVTOOLS_bccaa4aa80831b76c11240a16447975f" desc="Title of the Console tool">
Console Console
</message> </message>
<message name="IDS_DEVTOOLS_be53a0541a6d36f6ecb879fa2c584b08" desc="Text in Image View of the Sources panel">
Image
</message>
<message name="IDS_DEVTOOLS_be8545ae7ab0276e15898aae7acfbd7a" desc="Text that refers to the resources of the web page"> <message name="IDS_DEVTOOLS_be8545ae7ab0276e15898aae7acfbd7a" desc="Text that refers to the resources of the web page">
Resource Resource
</message> </message>
...@@ -523,6 +541,9 @@ ...@@ -523,6 +541,9 @@
<message name="IDS_DEVTOOLS_e24ee2487879116dcab772c0ac4fe341" desc="Text to focus on something"> <message name="IDS_DEVTOOLS_e24ee2487879116dcab772c0ac4fe341" desc="Text to focus on something">
Focus Focus
</message> </message>
<message name="IDS_DEVTOOLS_e402c138065e7eece783dc30c6079192" desc="Text that appears on a button for the xhr resource type filter.">
XHR
</message>
<message name="IDS_DEVTOOLS_e55f75a29310d7b60f7ac1d390c8ae42" desc="Text for a module, the programming concept"> <message name="IDS_DEVTOOLS_e55f75a29310d7b60f7ac1d390c8ae42" desc="Text for a module, the programming concept">
Module Module
</message> </message>
......
...@@ -192,7 +192,7 @@ Network.NetworkPanel = class extends UI.Panel { ...@@ -192,7 +192,7 @@ Network.NetworkPanel = class extends UI.Panel {
} }
_setupToolbarButtons(splitWidget) { _setupToolbarButtons(splitWidget) {
const searchToggle = new UI.ToolbarToggle('Search', 'largeicon-search'); const searchToggle = new UI.ToolbarToggle(ls`Search`, 'largeicon-search');
function updateSidebarToggle() { function updateSidebarToggle() {
searchToggle.setToggled(splitWidget.showMode() !== UI.SplitWidget.ShowMode.OnlyMain); searchToggle.setToggled(splitWidget.showMode() !== UI.SplitWidget.ShowMode.OnlyMain);
} }
......
...@@ -136,9 +136,6 @@ table is empty. ...@@ -136,9 +136,6 @@ table is empty.
<message name="IDS_DEVTOOLS_76c18f2b1e4155961e10434e3d83317f" desc="Text in Indexed DBViews of the Application panel"> <message name="IDS_DEVTOOLS_76c18f2b1e4155961e10434e3d83317f" desc="Text in Indexed DBViews of the Application panel">
Key generator value: <ph name="STRING_METADATA_KEYGENERATORVALUE_">$1s<ex>2</ex></ph> Key generator value: <ph name="STRING_METADATA_KEYGENERATORVALUE_">$1s<ex>2</ex></ph>
</message> </message>
<message name="IDS_DEVTOOLS_76c3e002d3c052bd6a909366a8dc3845" desc="Text in Application Panel Sidebar of the Application panel">
Manifest
</message>
<message name="IDS_DEVTOOLS_795a813f20a4d4b04f85ddb86287fce4" desc="Quota row title in Clear Storage View of the Application panel"> <message name="IDS_DEVTOOLS_795a813f20a4d4b04f85ddb86287fce4" desc="Quota row title in Clear Storage View of the Application panel">
Storage quota is limited in Incognito mode Storage quota is limited in Incognito mode
</message> </message>
......
...@@ -96,9 +96,6 @@ ...@@ -96,9 +96,6 @@
<message name="IDS_DEVTOOLS_3b2a3c8ed19fc3647432e72885d633e7" desc="Service worker running status displayed in the Service Workers view in the Application panel"> <message name="IDS_DEVTOOLS_3b2a3c8ed19fc3647432e72885d633e7" desc="Service worker running status displayed in the Service Workers view in the Application panel">
stopping stopping
</message> </message>
<message name="IDS_DEVTOOLS_3b563524fdb17b4a86590470d40bef74" desc="Text in DOMDebugger Model">
Media
</message>
<message name="IDS_DEVTOOLS_3c000cf06aef2d48a8bfe568e1d6ef65" desc="Tooltip to explain why a cookie was blocked"> <message name="IDS_DEVTOOLS_3c000cf06aef2d48a8bfe568e1d6ef65" desc="Tooltip to explain why a cookie was blocked">
This set-cookie was not sent over a secure connection and would have overwritten a cookie with the Secure attribute. This set-cookie was not sent over a secure connection and would have overwritten a cookie with the Secure attribute.
</message> </message>
...@@ -342,9 +339,6 @@ ...@@ -342,9 +339,6 @@
<message name="IDS_DEVTOOLS_e2b60c37530e144372a7943df0f6017d" desc="Text in Resource Tree Model"> <message name="IDS_DEVTOOLS_e2b60c37530e144372a7943df0f6017d" desc="Text in Resource Tree Model">
&lt;iframe&gt; &lt;iframe&gt;
</message> </message>
<message name="IDS_DEVTOOLS_e402c138065e7eece783dc30c6079192" desc="Text in DOMDebugger Model">
XHR
</message>
<message name="IDS_DEVTOOLS_e485c975c1d6c17d9dfd81128b83f63a" desc="Text in the Event Listener Breakpoints Panel of the JavaScript Debugger in the Sources Panel"> <message name="IDS_DEVTOOLS_e485c975c1d6c17d9dfd81128b83f63a" desc="Text in the Event Listener Breakpoints Panel of the JavaScript Debugger in the Sources Panel">
Set innerHTML Set innerHTML
</message> </message>
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
<message name="IDS_DEVTOOLS_0818b6e40afc14684d727176bd222aa0" desc="Title of a setting under the Sources category that can be invoked through the Command Menu"> <message name="IDS_DEVTOOLS_0818b6e40afc14684d727176bd222aa0" desc="Title of a setting under the Sources category that can be invoked through the Command Menu">
Set indentation to 2 spaces Set indentation to 2 spaces
</message> </message>
<message name="IDS_DEVTOOLS_194f5394ae2e9c74dc3c441b92862d1d" desc="Text in Font View of the Sources panel">
Font
</message>
<message name="IDS_DEVTOOLS_22a4f3a07431f171506336782f211c61" desc="Text that appears when user drag and drop something (for example, a file) in Image View of the Sources panel"> <message name="IDS_DEVTOOLS_22a4f3a07431f171506336782f211c61" desc="Text that appears when user drag and drop something (for example, a file) in Image View of the Sources panel">
Drop image file here Drop image file here
</message> </message>
...@@ -48,9 +45,6 @@ ...@@ -48,9 +45,6 @@
<message name="IDS_DEVTOOLS_af70cf4b9f56cd69eb56ae32f21e8416" desc="Text in Source Frame of the Sources panel"> <message name="IDS_DEVTOOLS_af70cf4b9f56cd69eb56ae32f21e8416" desc="Text in Source Frame of the Sources panel">
<ph name="SELECTIONS_LENGTH">$1d<ex>2</ex></ph> selection regions <ph name="SELECTIONS_LENGTH">$1d<ex>2</ex></ph> selection regions
</message> </message>
<message name="IDS_DEVTOOLS_be53a0541a6d36f6ecb879fa2c584b08" desc="Text in Image View of the Sources panel">
Image
</message>
<message name="IDS_DEVTOOLS_c144a6b9ff31ca0302b1cf94d4d540a0" desc="Text in Source Frame of the Sources panel"> <message name="IDS_DEVTOOLS_c144a6b9ff31ca0302b1cf94d4d540a0" desc="Text in Source Frame of the Sources panel">
<ph name="TEXTRANGE_ENDLINE___TEXTRANGE_STARTLINE____">$1d<ex>2</ex></ph> lines, <ph name="SELECTEDTEXT_LENGTH">$2d<ex>2</ex></ph> characters selected <ph name="TEXTRANGE_ENDLINE___TEXTRANGE_STARTLINE____">$1d<ex>2</ex></ph> lines, <ph name="SELECTEDTEXT_LENGTH">$2d<ex>2</ex></ph> characters selected
</message> </message>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment