Changeset 214405 in webkit
- Timestamp:
- Mar 25, 2017, 4:08:37 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r214387 r214405 1 2017-03-24 Brian Burg <bburg@apple.com> 2 3 Web Inspector: RTL: number scripts are used inconsistently throughout the UI 4 https://bugs.webkit.org/show_bug.cgi?id=168290 5 6 Reviewed by Joseph Pecoraro. 7 8 Original patch by Devin Rousso. 9 10 * Localizations/en.lproj/localizedStrings.js: Add new string for FPS bars. 11 * UserInterface/Base/Utilities.js: 12 (value.d): 13 (value): 14 Localize %d formatted values by default. If that's not desired, then you need to stringify 15 the number outside of String.format and Number.abbreviate and pass it as %s instead. 16 Also add a global variable for zwsp (zero-width space) and use it in DataGridNode. 17 18 * UserInterface/Views/ConsoleMessageView.js: 19 (WebInspector.ConsoleMessageView.prototype._renderRepeatCount): Abbreviate the repeat count, 20 and cause it to be localized. 21 22 * UserInterface/Views/DataGridNode.js: 23 (WebInspector.DataGridNode.prototype.createCellContent): 24 If we don't know anything about a cell's data other than that it's a number, 25 run the number through toLocaleString(). 26 27 * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: 28 Don't localize @%d tags for snapshot objects since this is not done elsewhere in the UI. 29 30 * UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js: Localize integer version number. 31 (WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.layout): 32 33 * UserInterface/Views/MemoryTimelineView.js: 34 (WebInspector.MemoryTimelineView.prototype._updateMaxComparisonLegend): Use Number.percentageString(). 35 36 * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js: 37 (WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateDividers.createDividerAtPosition): 38 (WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateDividers): 39 Localize "%d fps" markers. 40 41 * UserInterface/Views/TimelineOverview.js: 42 (WebInspector.TimelineOverview.prototype._viewModeDidChange): 43 Localize frame label numbers. 44 1 45 2017-03-24 Nikita Vasilyev <nvasilyev@apple.com> 2 46 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r214371 r214405 28 28 localizedStrings["%d \xd7 %d pixels"] = "%d \xd7 %d pixels"; 29 29 localizedStrings["%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)"] = "%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)"; 30 localizedStrings["%d fps"] = "%d fps"; 30 31 localizedStrings["%d matches"] = "%d matches"; 31 32 localizedStrings["%dpx"] = "%dpx"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js
r213890 r214405 28 28 var figureDash = "\u2012"; 29 29 var ellipsis = "\u2026"; 30 var zeroWidthSpace = "\u200b"; 30 31 31 32 Object.defineProperty(Object, "shallowCopy", … … 790 791 d: function(substitution) 791 792 { 792 return parseInt(substitution) ;793 return parseInt(substitution).toLocaleString(); 793 794 }, 794 795 … … 1092 1093 { 1093 1094 if (num < 1000) 1094 return num ;1095 return num.toLocaleString(); 1095 1096 1096 1097 if (num < 1000000) -
trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js
r214093 r214405 147 147 } 148 148 149 this._repeatCountElement.textContent = count;149 this._repeatCountElement.textContent = Number.abbreviate(count); 150 150 } 151 151 -
trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js
r214354 r214405 1 1 /* 2 * Copyright (C) 2008, 2013-201 6Apple Inc. All Rights Reserved.2 * Copyright (C) 2008, 2013-2017 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 384 384 createCellContent(columnIdentifier) 385 385 { 386 return this.data[columnIdentifier] || "\u200b"; // Zero width space to keep the cell from collapsing. 386 let data = this.data[columnIdentifier]; 387 if (!data) 388 return zeroWidthSpace; // Zero width space to keep the cell from collapsing. 389 390 return (typeof data === "number") ? data.maxDecimals(2).toLocaleString() : data; 387 391 } 388 392 -
trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js
r209709 r214405 55 55 let heapObjectIdentifier = node.id; 56 56 let shouldRevealConsole = true; 57 let text = WebInspector.UIString("Heap Snapshot Object ( @%d)").format(heapObjectIdentifier);57 let text = WebInspector.UIString("Heap Snapshot Object (%s)").format("@" + heapObjectIdentifier); 58 58 59 59 node.shortestGCRootPath((gcRootPath) => { -
trunk/Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js
r205043 r214405 105 105 this._databaseSecurityOriginRow.value = this._database.securityOrigin; 106 106 this._databaseNameRow.value = this._database.name; 107 this._databaseVersionRow.value = this._database.version ;107 this._databaseVersionRow.value = this._database.version.toLocaleString(); 108 108 } 109 109 -
trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js
r205425 r214405 338 338 339 339 // The chart will only show a perfect circle if the current and max are really the same value. 340 // So do a little massaging to ensure 99.95 doesn't get rounded up to 100.341 let percent = ((currentSize / this._maxSize) * 100);342 totalElement.textContent = (percent === 100 ? percent : (percent - 0.05).toFixed(1)) + "%";340 // So do a little massaging to ensure 0.9995 doesn't get rounded up to 1. 341 let percent = currentSize / this._maxSize; 342 totalElement.textContent = Number.percentageString(percent === 1 ? percent : (percent - 0.0005)); 343 343 } 344 344 -
trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.js
r214076 r214405 195 195 var label = document.createElement("div"); 196 196 label.classList.add("label"); 197 label.innerText = framesPerSecond + " fps";197 label.innerText = WebInspector.UIString("%d fps").format(framesPerSecond); 198 198 divider.appendChild(label); 199 199 -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js
r213997 r214405 752 752 this._timelineRuler.minimumSelectionDuration = 1; 753 753 this._timelineRuler.snapInterval = 1; 754 this._timelineRuler.formatLabelCallback = (value) => value. toFixed(0);754 this._timelineRuler.formatLabelCallback = (value) => value.maxDecimals(0).toLocaleString(); 755 755 } else { 756 756 this._timelineRuler.minimumSelectionDuration = 0.01;
Note:
See TracChangeset
for help on using the changeset viewer.