Commit 77f6f26b authored by Mandy Chen's avatar Mandy Chen Committed by Commit Bot

DevTools: Localize user facing strings in heap snapshot worker

Wrap user facing strings in heap snapshot worker with ls to localize them.

Bug: 941561
Change-Id: Ibe416185c7831213df4cfcf15c753cd469502f72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809506Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#698948}
parent 4c0a44fc
...@@ -912,34 +912,34 @@ HeapSnapshotWorker.HeapSnapshot = class { ...@@ -912,34 +912,34 @@ HeapSnapshotWorker.HeapSnapshot = class {
this._firstDominatedNodeIndex = new Uint32Array(this.nodeCount + 1); this._firstDominatedNodeIndex = new Uint32Array(this.nodeCount + 1);
this._dominatedNodes = new Uint32Array(this.nodeCount - 1); this._dominatedNodes = new Uint32Array(this.nodeCount - 1);
this._progress.updateStatus('Building edge indexes\u2026'); this._progress.updateStatus(ls`Building edge indexes\u2026`);
this._buildEdgeIndexes(); this._buildEdgeIndexes();
this._progress.updateStatus('Building retainers\u2026'); this._progress.updateStatus(ls`Building retainers\u2026`);
this._buildRetainers(); this._buildRetainers();
this._progress.updateStatus('Calculating node flags\u2026'); this._progress.updateStatus(ls`Calculating node flags\u2026`);
this.calculateFlags(); this.calculateFlags();
this._progress.updateStatus('Calculating distances\u2026'); this._progress.updateStatus(ls`Calculating distances\u2026`);
this.calculateDistances(); this.calculateDistances();
this._progress.updateStatus('Building postorder index\u2026'); this._progress.updateStatus(ls`Building postorder index\u2026`);
const result = this._buildPostOrderIndex(); const result = this._buildPostOrderIndex();
// Actually it is array that maps node ordinal number to dominator node ordinal number. // Actually it is array that maps node ordinal number to dominator node ordinal number.
this._progress.updateStatus('Building dominator tree\u2026'); this._progress.updateStatus(ls`Building dominator tree\u2026`);
this._dominatorsTree = this._dominatorsTree =
this._buildDominatorTree(result.postOrderIndex2NodeOrdinal, result.nodeOrdinal2PostOrderIndex); this._buildDominatorTree(result.postOrderIndex2NodeOrdinal, result.nodeOrdinal2PostOrderIndex);
this._progress.updateStatus('Calculating retained sizes\u2026'); this._progress.updateStatus(ls`Calculating retained sizes\u2026`);
this._calculateRetainedSizes(result.postOrderIndex2NodeOrdinal); this._calculateRetainedSizes(result.postOrderIndex2NodeOrdinal);
this._progress.updateStatus('Building dominated nodes\u2026'); this._progress.updateStatus(ls`Building dominated nodes\u2026`);
this._buildDominatedNodes(); this._buildDominatedNodes();
this._progress.updateStatus('Calculating statistics\u2026'); this._progress.updateStatus(ls`Calculating statistics\u2026`);
this.calculateStatistics(); this.calculateStatistics();
this._progress.updateStatus('Calculating samples\u2026'); this._progress.updateStatus(ls`Calculating samples\u2026`);
this._buildSamples(); this._buildSamples();
this._progress.updateStatus('Building locations\u2026'); this._progress.updateStatus(ls`Building locations\u2026`);
this._buildLocationMap(); this._buildLocationMap();
this._progress.updateStatus('Finished processing.'); this._progress.updateStatus(ls`Finished processing.`);
if (this._profile.snapshot.trace_function_count) { if (this._profile.snapshot.trace_function_count) {
this._progress.updateStatus('Building allocation statistics\u2026'); this._progress.updateStatus(ls`Building allocation statistics\u2026`);
const nodes = this.nodes; const nodes = this.nodes;
const nodesLength = nodes.length; const nodesLength = nodes.length;
const nodeFieldCount = this._nodeFieldCount; const nodeFieldCount = this._nodeFieldCount;
...@@ -956,7 +956,7 @@ HeapSnapshotWorker.HeapSnapshot = class { ...@@ -956,7 +956,7 @@ HeapSnapshotWorker.HeapSnapshot = class {
stats.ids.push(node.id()); stats.ids.push(node.id());
} }
this._allocationProfile = new HeapSnapshotWorker.AllocationProfile(this._profile, liveObjects); this._allocationProfile = new HeapSnapshotWorker.AllocationProfile(this._profile, liveObjects);
this._progress.updateStatus('Done'); this._progress.updateStatus(ls`Done`);
} }
} }
......
...@@ -109,7 +109,7 @@ HeapSnapshotWorker.HeapSnapshotLoader = class { ...@@ -109,7 +109,7 @@ HeapSnapshotWorker.HeapSnapshotLoader = class {
} }
_parseStringsArray() { _parseStringsArray() {
this._progress.updateStatus('Parsing strings\u2026'); this._progress.updateStatus(ls`Parsing strings\u2026`);
const closingBracketIndex = this._json.lastIndexOf(']'); const closingBracketIndex = this._json.lastIndexOf(']');
if (closingBracketIndex === -1) if (closingBracketIndex === -1)
throw new Error('Incomplete JSON'); throw new Error('Incomplete JSON');
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<grit-part> <grit-part>
<message name="IDS_DEVTOOLS_0f705e2ea0d470cf4e78f85ce73abc3c" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Calculating samples…
</message>
<message name="IDS_DEVTOOLS_15e828e7c9470740e5da2bd96f26809f" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building locations…
</message>
<message name="IDS_DEVTOOLS_1e6dbaafd43ee6c7ce436757c5563160" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building retainers…
</message>
<message name="IDS_DEVTOOLS_239026e523e6f9780426e03637c5b4a4" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_239026e523e6f9780426e03637c5b4a4" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading strings… Loading strings…
</message> </message>
<message name="IDS_DEVTOOLS_42b1c19d788d56dae8f4274ae0e06388" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building dominated nodes…
</message>
<message name="IDS_DEVTOOLS_508b42300b35ed4e3062adf330b76aad" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building dominator tree…
</message>
<message name="IDS_DEVTOOLS_58d7770bfad35df21bae2d5820e3be52" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building edge indexes…
</message>
<message name="IDS_DEVTOOLS_58e8a5ca400f834526b09d680ddbc5d5" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_58e8a5ca400f834526b09d680ddbc5d5" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading samples… Loading samples…
</message> </message>
<message name="IDS_DEVTOOLS_5e3a0ca620683b8428b4dbda33bf1f5d" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Finished processing.
</message>
<message name="IDS_DEVTOOLS_6a542856aa30e3e814eaed146e67b2fd" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_6a542856aa30e3e814eaed146e67b2fd" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading nodes… <ph name="PH1">$1d<ex>38</ex></ph>%% Loading nodes… <ph name="PH1">$1d<ex>38</ex></ph>%%
</message> </message>
<message name="IDS_DEVTOOLS_7da2f27d62adf93b01c2c041f37667b9" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_7da2f27d62adf93b01c2c041f37667b9" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Processing snapshot… Processing snapshot…
</message> </message>
<message name="IDS_DEVTOOLS_82e20e6748434e5048a36bf2d4b33578" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Calculating retained sizes…
</message>
<message name="IDS_DEVTOOLS_84c0ec1ee2bc769daf265e63bd793201" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_84c0ec1ee2bc769daf265e63bd793201" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading snapshot info… Loading snapshot info…
</message> </message>
<message name="IDS_DEVTOOLS_93093f55895541ab4360826523fe066e" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building postorder index…
</message>
<message name="IDS_DEVTOOLS_991feea6b04d59d7115962d5427a64fe" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Calculating node flags…
</message>
<message name="IDS_DEVTOOLS_9bdae72f224411b7f1027a2c5c7c519b" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_9bdae72f224411b7f1027a2c5c7c519b" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading locations… Loading locations…
</message> </message>
<message name="IDS_DEVTOOLS_b0da59cea23d810234b75c2357748ad3" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_b0da59cea23d810234b75c2357748ad3" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading edges… <ph name="PH1">$1d<ex>30</ex></ph>%% Loading edges… <ph name="PH1">$1d<ex>30</ex></ph>%%
</message> </message>
<message name="IDS_DEVTOOLS_bfb105e5a3da1a90bd1eb98b4fa36f3f" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Calculating statistics…
</message>
<message name="IDS_DEVTOOLS_d0622d0589a212a59cf8b5859e58c670" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Calculating distances…
</message>
<message name="IDS_DEVTOOLS_d67d63eca2747a30e1ffaeb04389c0bb" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot"> <message name="IDS_DEVTOOLS_d67d63eca2747a30e1ffaeb04389c0bb" desc="Text in Heap Snapshot Loader of the Memory panel when taking a heap snapshot">
Loading allocation traces… <ph name="PH1">$1d<ex>30</ex></ph>%% Loading allocation traces… <ph name="PH1">$1d<ex>30</ex></ph>%%
</message> </message>
<message name="IDS_DEVTOOLS_d86c288a983db9a91432d2d13386170f" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Building allocation statistics…
</message>
<message name="IDS_DEVTOOLS_f92965e2c8a7afb3c1b9a5c09a263636" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Done
</message>
<message name="IDS_DEVTOOLS_fae03f5c27a9765eec716f3e6c600945" desc="Text to indicate the status of a heap snapshot in the Performance Pane">
Parsing strings…
</message>
</grit-part> </grit-part>
\ No newline at end of file
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