Changeset 244952 in webkit


Ignore:
Timestamp:
May 4, 2019 6:31:10 PM (5 years ago)
Author:
Nikita Vasilyev
Message:

Web Inspector: Provide UIString descriptions to improve localizations
https://bugs.webkit.org/show_bug.cgi?id=195132
<rdar://problem/48457817>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Base/LoadLocalizedStrings.js:

(WI.UIString):
(WI.repeatedUIString.timelineRecordLayout):
(WI.repeatedUIString.timelineRecordPaint):
(WI.repeatedUIString.timelineRecordComposite):
(WI.repeatedUIString.allExceptions):
(WI.repeatedUIString.uncaughtExceptions):
(WI.repeatedUIString.assertionFailures):
(WI.repeatedUIString.allRequests):
(WI.repeatedUIString.fetch):
(WI.repeatedUIString.revealInDOMTree):

  • UserInterface/Models/LayoutTimelineRecord.js:

(WI.LayoutTimelineRecord.displayNameForEventType):

  • UserInterface/Models/RenderingFrameTimelineRecord.js:

(WI.RenderingFrameTimelineRecord.displayNameForTaskType):

  • UserInterface/Models/Resource.js:

(WI.Resource.displayNameForType):

  • UserInterface/Views/AuditTestGroupContentView.js:

(WI.AuditTestGroupContentView.prototype.layout):

  • UserInterface/Views/CPUTimelineView.js:

(WI.CPUTimelineView.displayNameForSampleType):

  • UserInterface/Views/ContextMenuUtilities.js:
  • UserInterface/Views/DOMBreakpointTreeElement.js:

(WI.DOMBreakpointTreeElement.displayNameForType):

  • UserInterface/Views/DOMNodeTreeElement.js:

(WI.DOMNodeTreeElement.prototype.populateContextMenu):
(WI.DOMNodeTreeElement):

  • UserInterface/Views/DOMTreeElement.js:

(WI.DOMTreeElement.prototype._populateTagContextMenu):
(WI.DOMTreeElement.prototype._populateNodeContextMenu):

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown):
(WI.DebuggerSidebarPanel):

  • UserInterface/Views/LayerTreeDetailsSidebarPanel.js:

(WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):

  • UserInterface/Views/NetworkTableContentView.js:

(WI.NetworkTableContentView.shortDisplayNameForResourceType):
(WI.NetworkTableContentView.prototype.initialLayout):

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown):

  • UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:

(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):

  • UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:

(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):

Tools:

Allow WI.UIString to take:

  • WI.UIString(string, key, comment)
  • WI.UIString(string, comment)
  • WI.UIString(string)
  • Scripts/extract-localizable-js-strings:
Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r244951 r244952  
     12019-05-04  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Provide UIString descriptions to improve localizations
     4        https://bugs.webkit.org/show_bug.cgi?id=195132
     5        <rdar://problem/48457817>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * Localizations/en.lproj/localizedStrings.js:
     10        * UserInterface/Base/LoadLocalizedStrings.js:
     11        (WI.UIString):
     12        (WI.repeatedUIString.timelineRecordLayout):
     13        (WI.repeatedUIString.timelineRecordPaint):
     14        (WI.repeatedUIString.timelineRecordComposite):
     15        (WI.repeatedUIString.allExceptions):
     16        (WI.repeatedUIString.uncaughtExceptions):
     17        (WI.repeatedUIString.assertionFailures):
     18        (WI.repeatedUIString.allRequests):
     19        (WI.repeatedUIString.fetch):
     20        (WI.repeatedUIString.revealInDOMTree):
     21        * UserInterface/Models/LayoutTimelineRecord.js:
     22        (WI.LayoutTimelineRecord.displayNameForEventType):
     23        * UserInterface/Models/RenderingFrameTimelineRecord.js:
     24        (WI.RenderingFrameTimelineRecord.displayNameForTaskType):
     25        * UserInterface/Models/Resource.js:
     26        (WI.Resource.displayNameForType):
     27        * UserInterface/Views/AuditTestGroupContentView.js:
     28        (WI.AuditTestGroupContentView.prototype.layout):
     29        * UserInterface/Views/CPUTimelineView.js:
     30        (WI.CPUTimelineView.displayNameForSampleType):
     31        * UserInterface/Views/ContextMenuUtilities.js:
     32        * UserInterface/Views/DOMBreakpointTreeElement.js:
     33        (WI.DOMBreakpointTreeElement.displayNameForType):
     34        * UserInterface/Views/DOMNodeTreeElement.js:
     35        (WI.DOMNodeTreeElement.prototype.populateContextMenu):
     36        (WI.DOMNodeTreeElement):
     37        * UserInterface/Views/DOMTreeElement.js:
     38        (WI.DOMTreeElement.prototype._populateTagContextMenu):
     39        (WI.DOMTreeElement.prototype._populateNodeContextMenu):
     40        * UserInterface/Views/DebuggerSidebarPanel.js:
     41        (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
     42        (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown):
     43        (WI.DebuggerSidebarPanel):
     44        * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
     45        (WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
     46        * UserInterface/Views/NetworkTableContentView.js:
     47        (WI.NetworkTableContentView.shortDisplayNameForResourceType):
     48        (WI.NetworkTableContentView.prototype.initialLayout):
     49        * UserInterface/Views/SourcesNavigationSidebarPanel.js:
     50        (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
     51        (WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown):
     52        * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
     53        (WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
     54        * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
     55        (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
     56
    1572019-05-04  Nikita Vasilyev  <nvasilyev@apple.com>
    258
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r244946 r244952  
    9898localizedStrings["All"] = "All";
    9999localizedStrings["All Changes"] = "All Changes";
     100/* Break (pause) on all exceptions */
    100101localizedStrings["All Exceptions"] = "All Exceptions";
    101102localizedStrings["All Layers"] = "All Layers";
     103/* A submenu item of 'Break on' that breaks (pauses) before all network requests */
    102104localizedStrings["All Requests"] = "All Requests";
    103105localizedStrings["All Resources"] = "All Resources";
     
    128130localizedStrings["Assertion Failed"] = "Assertion Failed";
    129131localizedStrings["Assertion Failed: %s"] = "Assertion Failed: %s";
     132/* Break (pause) when console.assert() fails */
    130133localizedStrings["Assertion Failures"] = "Assertion Failures";
    131134localizedStrings["Assertion with message: %s"] = "Assertion with message: %s";
     
    134137localizedStrings["Async audits are not supported."] = "Async audits are not supported.";
    135138localizedStrings["Attribute"] = "Attribute";
     139/* A submenu item of 'Break On' that breaks (pauses) before DOM attribute is modified */
    136140localizedStrings["Attribute Modified"] = "Attribute Modified";
    137141localizedStrings["Attributes"] = "Attributes";
     
    197201localizedStrings["Canvas Element"] = "Canvas Element";
    198202localizedStrings["Canvases"] = "Canvases";
     203/* Capture screenshot of the selected DOM node */
    199204localizedStrings["Capture Screenshot"] = "Capture Screenshot";
    200205localizedStrings["Capturing"] = "Capturing";
     
    210215localizedStrings["Charge \u201C%s\u201D to Callers"] = "Charge \u201C%s\u201D to Callers";
    211216localizedStrings["Checked"] = "Checked";
     217/* A submenu item of 'Add' to append DOM nodes to the selected DOM node */
    212218localizedStrings["Child"] = "Child";
    213219localizedStrings["Child Layers"] = "Child Layers";
     
    244250localizedStrings["Compare snapshots"] = "Compare snapshots";
    245251localizedStrings["Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording"] = "Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording";
    246 localizedStrings["Composite"] = "Composite";
     252/* Composite phase timeline records, where graphic layers are combined */
     253localizedStrings["Composite @ Timeline record"] = "Composite";
    247254localizedStrings["Composited"] = "Composited";
    248255localizedStrings["Compressed"] = "Compressed";
     
    464471localizedStrings["Failed to upgrade"] = "Failed to upgrade";
    465472localizedStrings["Failure status code"] = "Failure status code";
     473/* Resource loaded via 'fetch' method */
    466474localizedStrings["Fetch"] = "Fetch";
     475/* Resources loaded via 'fetch' method */
    467476localizedStrings["Fetches"] = "Fetches";
    468477localizedStrings["File or Resource"] = "File or Resource";
     
    481490localizedStrings["Force Light Appearance"] = "Force Light Appearance";
    482491localizedStrings["Force Print Media Styles"] = "Force Print Media Styles";
     492/* Layout phase records that were imperative (forced) */
    483493localizedStrings["Forced Layout"] = "Forced Layout";
     494/* A context menu item to force (override) a DOM node's pseudo-classes */
    484495localizedStrings["Forced Pseudo-Classes"] = "Forced Pseudo-Classes";
    485496localizedStrings["Format: HSL"] = "Format: HSL";
     
    571582localizedStrings["Info: "] = "Info: ";
    572583localizedStrings["Infos"] = "Infos";
     584/* A section of CSS rules matching an ancestor DOM node */
    573585localizedStrings["Inherited From"] = "Inherited From";
    574586localizedStrings["Initial State"] = "Initial State";
     
    599611localizedStrings["Layers"] = "Layers";
    600612localizedStrings["Layers:"] = "Layers:";
    601 localizedStrings["Layout"] = "Layout";
    602613localizedStrings["Layout & Rendering"] = "Layout & Rendering";
     614/* Layout phase timeline records */
     615localizedStrings["Layout @ Timeline record"] = "Layout";
    603616localizedStrings["Layout Invalidated"] = "Layout Invalidated";
    604617localizedStrings["Line %d"] = "Line %d";
     
    618631localizedStrings["Location"] = "Location";
    619632localizedStrings["Log Canvas Context"] = "Log Canvas Context";
     633/* Log (print) DOM element to Console */
    620634localizedStrings["Log Element"] = "Log Element";
    621635localizedStrings["Log Frame Text"] = "Log Frame Text";
    622636localizedStrings["Log Frame Value"] = "Log Frame Value";
    623637localizedStrings["Log Message"] = "Log Message";
     638/* Log (print) DOM node to Console */
    624639localizedStrings["Log Node"] = "Log Node";
    625640localizedStrings["Log Symbol"] = "Log Symbol";
     
    665680localizedStrings["Network Requests:"] = "Network Requests:";
    666681localizedStrings["New Tab"] = "New Tab";
     682/* A submenu item of 'Add' to add DOM nodes after the selected DOM node */
    667683localizedStrings["Next Sibling"] = "Next Sibling";
    668684localizedStrings["No"] = "No";
     
    705721localizedStrings["No response headers"] = "No response headers";
    706722localizedStrings["Node"] = "Node";
     723/* A submenu item of 'Break On' that breaks (pauses) before DOM node is removed */
    707724localizedStrings["Node Removed"] = "Node Removed";
    708725localizedStrings["Nodes"] = "Nodes";
     
    744761localizedStrings["Page navigated at %s"] = "Page navigated at %s";
    745762localizedStrings["Page reloaded at %s"] = "Page reloaded at %s";
    746 localizedStrings["Paint"] = "Paint";
     763/* Paint (render) phase timeline records */
     764localizedStrings["Paint @ Timeline record"] = "Paint";
    747765localizedStrings["Paints"] = "Paints";
     766/* A count of how many times an element was painted (rendered) */
     767localizedStrings["Paints @ Column title"] = "Paints";
    748768localizedStrings["Parent"] = "Parent";
    749769localizedStrings["Partial Garbage Collection"] = "Partial Garbage Collection";
     
    775795localizedStrings["Pretty print"] = "Pretty print";
    776796localizedStrings["Preview"] = "Preview";
     797/* A submenu item of 'Add' to add DOM nodes before the selected DOM node */
    777798localizedStrings["Previous Sibling"] = "Previous Sibling";
    778799localizedStrings["Primary Key"] = "Primary Key";
     
    862883localizedStrings["Return value is not an object, string, or boolean"] = "Return value is not an object, string, or boolean";
    863884localizedStrings["Reveal Breakpoint"] = "Reveal Breakpoint";
     885/* Open Elements tab and select this node in DOM tree */
    864886localizedStrings["Reveal in DOM Tree"] = "Reveal in DOM Tree";
    865887localizedStrings["Reveal in Debugger Tab"] = "Reveal in Debugger Tab";
    866888localizedStrings["Reveal in Elements Tab"] = "Reveal in Elements Tab";
     889/* Open Layers tab and select the layer corresponding to this node */
    867890localizedStrings["Reveal in Layers Tab"] = "Reveal in Layers Tab";
    868891localizedStrings["Reveal in Network Tab"] = "Reveal in Network Tab";
     
    893916localizedStrings["Script Evaluated"] = "Script Evaluated";
    894917localizedStrings["Scripts"] = "Scripts";
    895 localizedStrings["Scroll Into View"] = "Scroll Into View";
     918/* Scroll selected DOM node into view on the inspected web page */
     919localizedStrings["Scroll into View"] = "Scroll into View";
    896920localizedStrings["Search"] = "Search";
    897921localizedStrings["Search Again"] = "Search Again";
     
    908932localizedStrings["Selected"] = "Selected";
    909933localizedStrings["Selected Canvas Context"] = "Selected Canvas Context";
     934/* Selected DOM element */
    910935localizedStrings["Selected Element"] = "Selected Element";
    911936localizedStrings["Selected Frame"] = "Selected Frame";
    912937localizedStrings["Selected Item"] = "Selected Item";
    913938localizedStrings["Selected Items"] = "Selected Items";
     939/* Selected DOM node */
    914940localizedStrings["Selected Node"] = "Selected Node";
    915941localizedStrings["Selected Symbol"] = "Selected Symbol";
     
    10121038localizedStrings["Stopping the \u201C%s\u201D audit"] = "Stopping the \u201C%s\u201D audit";
    10131039localizedStrings["Storage"] = "Storage";
     1040/* CSS properties defined via HTML style attribute */
    10141041localizedStrings["Style Attribute"] = "Style Attribute";
    10151042localizedStrings["Style Resolution"] = "Style Resolution";
     
    10241051localizedStrings["Stylesheets"] = "Stylesheets";
    10251052localizedStrings["Subject"] = "Subject";
     1053/* A submenu item of 'Break On' that breaks (pauses) before child DOM node is modified */
    10261054localizedStrings["Subtree Modified"] = "Subtree Modified";
    10271055localizedStrings["Summary"] = "Summary";
     
    10301058localizedStrings["Tab width:"] = "Tab width:";
    10311059localizedStrings["Tabs"] = "Tabs";
     1060/* A submenu item of 'Edit' to change DOM element's tag name */
    10321061localizedStrings["Tag"] = "Tag";
    10331062localizedStrings["Take snapshot"] = "Take snapshot";
     
    10921121localizedStrings["Trace"] = "Trace";
    10931122localizedStrings["Trace: %s"] = "Trace: %s";
     1123/* Amount of data sent over the network for a single resource */
    10941124localizedStrings["Transfer Size"] = "Transfer Size";
    10951125localizedStrings["Transferred"] = "Transferred";
     
    11061136localizedStrings["Unable to parse as JSON: %s"] = "Unable to parse as JSON: %s";
    11071137localizedStrings["Unable to show certificate for \u201C%s\u201D"] = "Unable to show certificate for \u201C%s\u201D";
     1138/* Break (pause) on uncaught (unhandled) exceptions */
    11081139localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions";
    11091140localizedStrings["Undefined custom element"] = "Undefined custom element";
  • trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js

    r239452 r244952  
    4444WI.UIString = function(string, key, comment)
    4545{
     46    "use strict";
     47
    4648    if (WI.dontLocalizeUserInterface)
    4749        return string;
     50
     51    // UIString(string, comment)
     52    if (arguments.length === 2) {
     53        comment = key;
     54        key = undefined;
     55    }
    4856
    4957    key = key || string;
     
    6573    return "LOCALIZED STRING NOT FOUND";
    6674};
     75
     76WI.repeatedUIString = {};
     77
     78WI.repeatedUIString.timelineRecordLayout = function() {
     79    return WI.UIString("Layout", "Layout @ Timeline record", "Layout phase timeline records");
     80};
     81
     82WI.repeatedUIString.timelineRecordPaint = function() {
     83    return WI.UIString("Paint", "Paint @ Timeline record", "Paint (render) phase timeline records");
     84};
     85
     86WI.repeatedUIString.timelineRecordComposite = function() {
     87    return WI.UIString("Composite", "Composite @ Timeline record", "Composite phase timeline records, where graphic layers are combined");
     88};
     89
     90WI.repeatedUIString.allExceptions = function() {
     91    return WI.UIString("All Exceptions", "Break (pause) on all exceptions");
     92};
     93
     94WI.repeatedUIString.uncaughtExceptions = function() {
     95    return WI.UIString("Uncaught Exceptions", "Break (pause) on uncaught (unhandled) exceptions");
     96};
     97
     98WI.repeatedUIString.assertionFailures = function() {
     99    return WI.UIString("Assertion Failures", "Break (pause) when console.assert() fails");
     100};
     101
     102WI.repeatedUIString.allRequests = function() {
     103    return WI.UIString("All Requests", "A submenu item of 'Break on' that breaks (pauses) before all network requests");
     104};
     105
     106WI.repeatedUIString.fetch = function() {
     107    return WI.UIString("Fetch", "Resource loaded via 'fetch' method");
     108};
     109
     110WI.repeatedUIString.revealInDOMTree = function() {
     111    return WI.UIString("Reveal in DOM Tree", "Open Elements tab and select this node in DOM tree");
     112};
  • trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js

    r243024 r244952  
    5252            return WI.UIString("Layout Invalidated");
    5353        case WI.LayoutTimelineRecord.EventType.ForcedLayout:
    54             return WI.UIString("Forced Layout");
     54            return WI.UIString("Forced Layout", "Layout phase records that were imperative (forced)");
    5555        case WI.LayoutTimelineRecord.EventType.Layout:
    56             return WI.UIString("Layout");
     56            return WI.repeatedUIString.timelineRecordLayout();
    5757        case WI.LayoutTimelineRecord.EventType.Paint:
    58             return WI.UIString("Paint");
     58            return WI.repeatedUIString.timelineRecordPaint();
    5959        case WI.LayoutTimelineRecord.EventType.Composite:
    60             return WI.UIString("Composite");
     60            return WI.repeatedUIString.timelineRecordComposite();
    6161        }
    6262    }
  • trunk/Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js

    r243024 r244952  
    4747            return WI.UIString("Script");
    4848        case WI.RenderingFrameTimelineRecord.TaskType.Layout:
    49             return WI.UIString("Layout");
     49            return WI.repeatedUIString.timelineRecordLayout();
    5050        case WI.RenderingFrameTimelineRecord.TaskType.Paint:
    51             return WI.UIString("Paint");
     51            return WI.repeatedUIString.timelineRecordPaint();
    5252        case WI.RenderingFrameTimelineRecord.TaskType.Other:
    5353            return WI.UIString("Other");
  • trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js

    r243614 r244952  
    157157        case WI.Resource.Type.Fetch:
    158158            if (plural)
    159                 return WI.UIString("Fetches");
    160             return WI.UIString("Fetch");
     159                return WI.UIString("Fetches", "Resources loaded via 'fetch' method");
     160            return WI.repeatedUIString.fetch();
    161161        case WI.Resource.Type.Ping:
    162162            if (plural)
  • trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js

    r242604 r244952  
    126126            };
    127127
    128             addScopeBarItem(WI.AuditTestCaseResult.Level.Pass, WI.UIString("%d Passed", "%d Passed (singular)"), WI.UIString("%d Passed", "%d Passed (plural)"));
     128            addScopeBarItem(WI.AuditTestCaseResult.Level.Pass, WI.UIString("%d Passed", "%d Passed (singular)", ""), WI.UIString("%d Passed", "%d Passed (plural)", ""));
    129129            addScopeBarItem(WI.AuditTestCaseResult.Level.Warn, WI.UIString("%d Warning"), WI.UIString("%d Warnings"));
    130             addScopeBarItem(WI.AuditTestCaseResult.Level.Fail, WI.UIString("%d Failed", "%d Failed (singular)"), WI.UIString("%d Failed", "%d Failed (plural)"));
     130            addScopeBarItem(WI.AuditTestCaseResult.Level.Fail, WI.UIString("%d Failed", "%d Failed (singular)", ""), WI.UIString("%d Failed", "%d Failed (plural)", ""));
    131131            addScopeBarItem(WI.AuditTestCaseResult.Level.Error, WI.UIString("%d Error"), WI.UIString("%d Errors"));
    132             addScopeBarItem(WI.AuditTestCaseResult.Level.Unsupported, WI.UIString("%d Unsupported", "%d Unsupported (singular)"), WI.UIString("%d Unsupported", "%d Unsupported (plural)"));
     132            addScopeBarItem(WI.AuditTestCaseResult.Level.Unsupported, WI.UIString("%d Unsupported", "%d Unsupported (singular)", ""), WI.UIString("%d Unsupported", "%d Unsupported (plural)", ""));
    133133
    134134            this._levelScopeBar = new WI.ScopeBar(null, scopeBarItems);
  • trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js

    r244411 r244952  
    5858            return WI.UIString("Script");
    5959        case WI.CPUTimelineView.SampleType.Layout:
    60             return WI.UIString("Layout");
     60            return WI.repeatedUIString.timelineRecordLayout();
    6161        case WI.CPUTimelineView.SampleType.Paint:
    62             return WI.UIString("Paint");
     62            return WI.repeatedUIString.timelineRecordPaint();
    6363        case WI.CPUTimelineView.SampleType.Style:
    6464            return WI.UIString("Style Resolution");
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js

    r243722 r244952  
    217217
    218218    if (!options.excludeLogElement && !domNode.isInUserAgentShadowTree() && !domNode.isPseudoElement()) {
    219         let label = isElement ? WI.UIString("Log Element") : WI.UIString("Log Node");
     219        let label = isElement ? WI.UIString("Log Element", "Log (print) DOM element to Console") : WI.UIString("Log Node", "Log (print) DOM node to Console");
    220220        contextMenu.appendItem(label, () => {
    221221            WI.RemoteObject.resolveNode(domNode, WI.RuntimeManager.ConsoleObjectGroup).then((remoteObject) => {
    222                 let text = isElement ? WI.UIString("Selected Element") : WI.UIString("Selected Node");
     222                let text = isElement ? WI.UIString("Selected Element", "Selected DOM element") : WI.UIString("Selected Node", "Selected DOM node");
    223223                const addSpecialUserLogClass = true;
    224224                WI.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, addSpecialUserLogClass);
     
    228228
    229229    if (!options.excludeRevealElement && window.DOMAgent && attached) {
    230         contextMenu.appendItem(WI.UIString("Reveal in DOM Tree"), () => {
     230        contextMenu.appendItem(WI.repeatedUIString.revealInDOMTree(), () => {
    231231            WI.domManager.inspectElement(domNode.id);
    232232        });
     
    234234
    235235    if (WI.settings.experimentalEnableLayersTab.value && window.LayerTreeAgent && attached) {
    236         contextMenu.appendItem(WI.UIString("Reveal in Layers Tab"), () => {
     236        contextMenu.appendItem(WI.UIString("Reveal in Layers Tab", "Open Layers tab and select the layer corresponding to this node"), () => {
    237237            WI.showLayersTab({nodeToSelect: domNode});
    238238        });
     
    240240
    241241    if (window.PageAgent && attached) {
    242         contextMenu.appendItem(WI.UIString("Capture Screenshot"), () => {
     242        contextMenu.appendItem(WI.UIString("Capture Screenshot", "Capture screenshot of the selected DOM node"), () => {
    243243            PageAgent.snapshotNode(domNode.id, (error, dataURL) => {
    244244                if (error) {
     
    263263
    264264    if (isElement && attached) {
    265         contextMenu.appendItem(WI.UIString("Scroll Into View"), () => {
     265        contextMenu.appendItem(WI.UIString("Scroll into View", "Scroll selected DOM node into view on the inspected web page"), () => {
    266266            domNode.scrollIntoView();
    267267        });
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js

    r242318 r244952  
    5151        switch (type) {
    5252        case WI.DOMBreakpoint.Type.SubtreeModified:
    53             return WI.UIString("Subtree Modified");
     53            return WI.UIString("Subtree Modified", "A submenu item of 'Break On' that breaks (pauses) before child DOM node is modified");
    5454        case WI.DOMBreakpoint.Type.AttributeModified:
    55             return WI.UIString("Attribute Modified");
     55            return WI.UIString("Attribute Modified", "A submenu item of 'Break On' that breaks (pauses) before DOM attribute is modified");
    5656        case WI.DOMBreakpoint.Type.NodeRemoved:
    57             return WI.UIString("Node Removed");
     57            return WI.UIString("Node Removed", "A submenu item of 'Break On' that breaks (pauses) before DOM node is removed");
    5858        default:
    5959            console.error("Unexpected DOM breakpoint type: " + type);
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js

    r243722 r244952  
    6262        contextMenu.appendSeparator();
    6363
    64         contextMenu.appendItem(WI.UIString("Reveal in DOM Tree"), () => {
     64        contextMenu.appendItem(WI.repeatedUIString.revealInDOMTree(), () => {
    6565            WI.domManager.inspectElement(this.representedObject.id);
    6666        });
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js

    r244566 r244952  
    778778        }, !attribute || !isNonShadowEditable);
    779779
    780         subMenus.edit.appendItem(WI.UIString("Tag"), () => {
     780        subMenus.edit.appendItem(WI.UIString("Tag", "A submenu item of 'Edit' to change DOM element's tag name"), () => {
    781781            this._startEditingTagName();
    782782        }, !isNonShadowEditable);
     
    785785
    786786        if (WI.cssManager.canForcePseudoClasses() && attached) {
    787             let pseudoSubMenu = contextMenu.appendSubMenuItem(WI.UIString("Forced Pseudo-Classes"));
     787            let pseudoSubMenu = contextMenu.appendSubMenuItem(WI.UIString("Forced Pseudo-Classes", "A context menu item to force (override) a DOM node's pseudo-classes"));
    788788
    789789            let enabledPseudoClasses = node.enabledPseudoClasses;
     
    816816        let isEditableNode = node.nodeType() === Node.ELEMENT_NODE && this.editable;
    817817        let forbiddenClosingTag = WI.DOMTreeElement.ForbiddenClosingTagElements.has(node.nodeNameInCorrectCase());
    818         subMenus.add.appendItem(WI.UIString("Child"), this._addHTML.bind(this), forbiddenClosingTag || !isEditableNode);
    819         subMenus.add.appendItem(WI.UIString("Previous Sibling"), this._addPreviousSibling.bind(this), !isEditableNode);
    820         subMenus.add.appendItem(WI.UIString("Next Sibling"), this._addNextSibling.bind(this), !isEditableNode);
     818        subMenus.add.appendItem(WI.UIString("Child", "A submenu item of 'Add' to append DOM nodes to the selected DOM node"), this._addHTML.bind(this), forbiddenClosingTag || !isEditableNode);
     819        subMenus.add.appendItem(WI.UIString("Previous Sibling", "A submenu item of 'Add' to add DOM nodes before the selected DOM node"), this._addPreviousSibling.bind(this), !isEditableNode);
     820        subMenus.add.appendItem(WI.UIString("Next Sibling", "A submenu item of 'Add' to add DOM nodes after the selected DOM node"), this._addNextSibling.bind(this), !isEditableNode);
    821821
    822822        subMenus.edit.appendItem(WI.UIString("HTML"), this._editAsHTML.bind(this), !this.editable);
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r244195 r244952  
    475475        if (breakpoint === WI.debuggerManager.allExceptionsBreakpoint) {
    476476            options.className = WI.DebuggerSidebarPanel.ExceptionIconStyleClassName;
    477             options.title = WI.UIString("All Exceptions");
     477            options.title = WI.repeatedUIString.allExceptions();
    478478        } else if (breakpoint === WI.debuggerManager.uncaughtExceptionsBreakpoint) {
    479479            options.className = WI.DebuggerSidebarPanel.ExceptionIconStyleClassName;
    480             options.title = WI.UIString("Uncaught Exceptions");
     480            options.title = WI.repeatedUIString.uncaughtExceptions();
    481481        } else if (breakpoint === WI.debuggerManager.assertionFailuresBreakpoint) {
    482482            options.className = WI.DebuggerSidebarPanel.AssertionIconStyleClassName;
    483             options.title = WI.UIString("Assertion Failures");
     483            options.title = WI.repeatedUIString.assertionFailures();
    484484        } else if (breakpoint instanceof WI.DOMBreakpoint) {
    485485            if (!breakpoint.domNodeIdentifier)
     
    515515            if (breakpoint === WI.domDebuggerManager.allRequestsBreakpoint) {
    516516                options.className = WI.DebuggerSidebarPanel.AssertionIconStyleClassName;
    517                 options.title = WI.UIString("All Requests");
     517                options.title = WI.repeatedUIString.allRequests();
    518518            }
    519519        } else {
     
    14581458            let assertionFailuresBreakpointShown = WI.settings.showAssertionFailuresBreakpoint.value;
    14591459
    1460             contextMenu.appendCheckboxItem(WI.UIString("Assertion Failures"), () => {
     1460            contextMenu.appendCheckboxItem(WI.repeatedUIString.assertionFailures(), () => {
    14611461                if (assertionFailuresBreakpointShown)
    14621462                    WI.debuggerManager.removeBreakpoint(WI.debuggerManager.assertionFailuresBreakpoint);
     
    14801480            let allRequestsBreakpointShown = WI.settings.showAllRequestsBreakpoint.value;
    14811481
    1482             contextMenu.appendCheckboxItem(WI.UIString("All Requests"), () => {
     1482            contextMenu.appendCheckboxItem(WI.repeatedUIString.allRequests(), () => {
    14831483                if (allRequestsBreakpointShown)
    14841484                    WI.domDebuggerManager.removeURLBreakpoint(WI.domDebuggerManager.allRequestsBreakpoint);
  • trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js

    r239345 r244952  
    137137        columns.name.sortable = false;
    138138
    139         columns.paintCount.title = WI.UIString("Paints");
     139        columns.paintCount.title = WI.UIString("Paints", "Paints @ Column title", "A count of how many times an element was painted (rendered)");
    140140        columns.paintCount.sortable = true;
    141141        columns.paintCount.aligned = "right";
  • trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js

    r244933 r244952  
    212212            return "XHR";
    213213        case WI.Resource.Type.Fetch:
    214             return WI.UIString("Fetch");
     214            return WI.repeatedUIString.fetch();
    215215        case WI.Resource.Type.Ping:
    216216            return WI.UIString("Ping");
     
    11731173        });
    11741174
    1175         this._transferSizeColumn = new WI.TableColumn("transferSize", WI.UIString("Transfer Size"), {
     1175        this._transferSizeColumn = new WI.TableColumn("transferSize", WI.UIString("Transfer Size", "Amount of data sent over the network for a single resource"), {
    11761176            minWidth: 100,
    11771177            maxWidth: 150,
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

    r244195 r244952  
    884884        if (breakpoint === WI.debuggerManager.allExceptionsBreakpoint) {
    885885            options.className = "breakpoint-exception-icon";
    886             options.title = WI.UIString("All Exceptions");
     886            options.title = WI.repeatedUIString.allExceptions();
    887887        } else if (breakpoint === WI.debuggerManager.uncaughtExceptionsBreakpoint) {
    888888            options.className = "breakpoint-exception-icon";
    889             options.title = WI.UIString("Uncaught Exceptions");
     889            options.title = WI.repeatedUIString.uncaughtExceptions();
    890890        } else if (breakpoint === WI.debuggerManager.assertionFailuresBreakpoint) {
    891891            options.className = "breakpoint-assertion-icon";
    892             options.title = WI.UIString("Assertion Failures");
     892            options.title = WI.repeatedUIString.assertionFailures();
    893893        } else if (breakpoint instanceof WI.DOMBreakpoint) {
    894894            if (!breakpoint.domNodeIdentifier)
     
    924924            if (breakpoint === WI.domDebuggerManager.allRequestsBreakpoint) {
    925925                options.className = "breakpoint-assertion-icon";
    926                 options.title = WI.UIString("All Requests");
     926                options.title = WI.repeatedUIString.allRequests();
    927927            }
    928928        } else {
     
    15031503            let assertionFailuresBreakpointShown = WI.settings.showAssertionFailuresBreakpoint.value;
    15041504
    1505             contextMenu.appendCheckboxItem(WI.UIString("Assertion Failures"), () => {
     1505            contextMenu.appendCheckboxItem(WI.repeatedUIString.assertionFailures(), () => {
    15061506                if (assertionFailuresBreakpointShown)
    15071507                    WI.debuggerManager.removeBreakpoint(WI.debuggerManager.assertionFailuresBreakpoint);
     
    15251525            let allRequestsBreakpointShown = WI.settings.showAllRequestsBreakpoint.value;
    15261526
    1527             contextMenu.appendCheckboxItem(WI.UIString("All Requests"), () => {
     1527            contextMenu.appendCheckboxItem(WI.repeatedUIString.allRequests(), () => {
    15281528                if (allRequestsBreakpointShown)
    15291529                    WI.domDebuggerManager.removeURLBreakpoint(WI.domDebuggerManager.allRequestsBreakpoint);
  • trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js

    r244616 r244952  
    316316
    317317        case WI.CSSStyleDeclaration.Type.Inline:
    318             this._selectorElement.textContent = WI.UIString("Style Attribute");
     318            this._selectorElement.textContent = WI.UIString("Style Attribute", "CSS properties defined via HTML style attribute");
    319319            this._selectorElement.classList.add("style-attribute");
    320320            break;
  • trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js

    r243264 r244952  
    257257        let addSection = (section) => {
    258258            if (section.style.inherited && (!previousStyle || previousStyle.node !== section.style.node))
    259                 addHeader(WI.UIString("Inherited From"), section.style.node);
     259                addHeader(WI.UIString("Inherited From", "A section of CSS rules matching an ancestor DOM node"), section.style.node);
    260260
    261261            if (!section.isDescendantOf(this)) {
  • trunk/Tools/ChangeLog

    r244945 r244952  
     12019-05-04  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Provide UIString descriptions to improve localizations
     4        https://bugs.webkit.org/show_bug.cgi?id=195132
     5        <rdar://problem/48457817>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Allow WI.UIString to take:
     10        - WI.UIString(string, key, comment)
     11        - WI.UIString(string, comment)
     12        - WI.UIString(string)
     13
     14        * Scripts/extract-localizable-js-strings:
     15
    1162019-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>
    217
  • trunk/Tools/Scripts/extract-localizable-js-strings

    r239452 r244952  
    7575
    7676        # Handle WebInspector strings. Prints a warning if a non-string literal is passed to WI.UIString().
    77         HandleUIString($1, $2 || $1, $3 || "", $file, $.) while s/WI\.UIString\("([^"]+)"(?:,\s*"([^"]+)"(?:,\s*"([^"]+)")?)?\)//;
     77        # Allow: WI.UIString(string, comment)
     78        #        WI.UIString(string, key, comment)
     79        HandleUIString(
     80            $1,
     81            ($3 || (defined $3 and length $3 == 0)) ? $2 : $1,
     82            ($3 || (defined $3 and length $3 == 0)) ? $3 : $2 || "",
     83            $file,
     84            $.
     85        ) while s/WI\.UIString\("([^"]+)"(?:,\s*"([^"]*)"(?:,\s*"([^"]*)")?)?\)//;
    7886        print "$file:$.:WARNING: $&\n" while s/WI\.UIString\(.*?\)//;
    7987
Note: See TracChangeset for help on using the changeset viewer.