Fix swap approval translation
Add fallback for swapApproval token symbol to prevent i18n substitution errors when the symbol is missing.
The i18n system throws an error if a substitution value is null or undefined. Previously, if both bridgeTokenDisplayData.sourceTokenSymbol and primaryTransaction.sourceTokenSymbol were missing for a swapApproval transaction, the t() function would receive an undefined value, leading to the "Insufficient number of substitutions" error. This change ensures a generic "Token" label is used as a fallback in such cases.
Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents
CLA Signature Action:
Thank you for your submission, we really appreciate it. We ask that you read and sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just by adding a comment to this pull request with this exact sentence:
I have read the CLA Document and I hereby sign the CLA
By commenting with the above message you are agreeing to the terms of the CLA. Your account will be recorded as agreeing to our CLA so you don't need to sign it again for future contributions to this repository.
0 out of 1 committers have signed the CLA. :x: @cursoragent
Builds ready [acd22c4]
- builds: chrome, firefox
- builds (beta): chrome, firefox
- builds (flask): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- bundle size: Bundle Size Stats
- user-actions-benchmark: User Actions Stats
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
UI Startup Metrics (1297 ± 120 ms)
| Platform | BuildType | Page | Metric | Mean (ms) | Min (ms) | Max (ms) | Std Dev (ms) | P 75 (ms) | P 95 (ms) |
|---|---|---|---|---|---|---|---|---|---|
| Chrome | Browserify | Standard Home | uiStartup | 1297 | 1036 | 1574 | 120 | 1373 | 1514 |
| load | 1056 | 856 | 1297 | 95 | 1110 | 1236 | |||
| domContentLoaded | 1049 | 849 | 1282 | 94 | 1098 | 1220 | |||
| domInteractive | 26 | 15 | 96 | 18 | 22 | 77 | |||
| firstPaint | 521 | 83 | 1232 | 412 | 1018 | 1176 | |||
| backgroundConnect | 221 | 196 | 284 | 16 | 228 | 258 | |||
| firstReactRender | 43 | 31 | 91 | 12 | 45 | 74 | |||
| getState | 35 | 18 | 118 | 18 | 38 | 67 | |||
| initialActions | 1 | 0 | 7 | 1 | 1 | 1 | |||
| loadScripts | 836 | 654 | 1055 | 88 | 888 | 981 | |||
| setupStore | 11 | 6 | 28 | 4 | 11 | 20 | |||
| numNetworkReqs | 13 | 6 | 81 | 19 | 6 | 68 | |||
| Browserify | Power User Home | uiStartup | 1912 | 1553 | 2628 | 199 | 1995 | 2278 | |
| load | 1067 | 905 | 1575 | 124 | 1123 | 1300 | |||
| domContentLoaded | 1056 | 896 | 1561 | 123 | 1111 | 1286 | |||
| domInteractive | 32 | 18 | 147 | 27 | 28 | 113 | |||
| firstPaint | 657 | 96 | 1573 | 436 | 1065 | 1304 | |||
| backgroundConnect | 242 | 205 | 632 | 74 | 233 | 481 | |||
| firstReactRender | 49 | 39 | 81 | 7 | 51 | 62 | |||
| getState | 203 | 146 | 731 | 96 | 205 | 279 | |||
| initialActions | 1 | 0 | 2 | 1 | 1 | 2 | |||
| loadScripts | 841 | 693 | 1304 | 120 | 897 | 1075 | |||
| setupStore | 17 | 10 | 40 | 8 | 16 | 35 | |||
| numNetworkReqs | 71 | 58 | 227 | 23 | 68 | 121 | |||
| Webpack | Standard Home | uiStartup | 821 | 684 | 1071 | 78 | 855 | 963 | |
| load | 665 | 574 | 860 | 74 | 713 | 810 | |||
| domContentLoaded | 659 | 569 | 855 | 74 | 708 | 805 | |||
| domInteractive | 27 | 16 | 113 | 21 | 22 | 89 | |||
| firstPaint | 253 | 98 | 836 | 178 | 223 | 693 | |||
| backgroundConnect | 11 | 5 | 42 | 5 | 11 | 17 | |||
| firstReactRender | 54 | 33 | 206 | 36 | 56 | 142 | |||
| getState | 27 | 14 | 57 | 10 | 34 | 51 | |||
| initialActions | 1 | 0 | 4 | 1 | 1 | 2 | |||
| loadScripts | 656 | 567 | 846 | 73 | 705 | 802 | |||
| setupStore | 11 | 6 | 41 | 5 | 14 | 21 | |||
| numNetworkReqs | 14 | 6 | 83 | 20 | 6 | 72 | |||
| Webpack | Power User Home | uiStartup | 1432 | 1106 | 2282 | 226 | 1632 | 1814 | |
| load | 726 | 597 | 1063 | 109 | 836 | 929 | |||
| domContentLoaded | 719 | 590 | 1056 | 109 | 823 | 924 | |||
| domInteractive | 32 | 16 | 157 | 29 | 27 | 109 | |||
| firstPaint | 294 | 89 | 897 | 218 | 299 | 846 | |||
| backgroundConnect | 90 | 8 | 644 | 165 | 91 | 596 | |||
| firstReactRender | 49 | 41 | 79 | 5 | 52 | 58 | |||
| getState | 178 | 141 | 258 | 28 | 189 | 246 | |||
| initialActions | 1 | 0 | 3 | 1 | 1 | 1 | |||
| loadScripts | 716 | 588 | 1047 | 108 | 821 | 916 | |||
| setupStore | 13 | 7 | 39 | 6 | 13 | 32 | |||
| numNetworkReqs | 72 | 57 | 237 | 27 | 67 | 142 | |||
| Firefox | Browserify | Standard Home | uiStartup | 1306 | 1080 | 2485 | 245 | 1354 | 1848 |
| load | 1070 | 899 | 2192 | 198 | 1105 | 1310 | |||
| domContentLoaded | 1069 | 898 | 2192 | 198 | 1105 | 1310 | |||
| domInteractive | 80 | 31 | 1172 | 155 | 84 | 147 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 46 | 20 | 290 | 39 | 51 | 108 | |||
| firstReactRender | 37 | 30 | 69 | 8 | 38 | 57 | |||
| getState | 11 | 7 | 70 | 9 | 11 | 24 | |||
| initialActions | 1 | 0 | 2 | 0 | 1 | 2 | |||
| loadScripts | 1044 | 883 | 2127 | 191 | 1080 | 1249 | |||
| setupStore | 15 | 6 | 241 | 26 | 10 | 40 | |||
| numNetworkReqs | 15 | 6 | 81 | 21 | 9 | 75 | |||
| Browserify | Power User Home | uiStartup | 2721 | 1807 | 4301 | 528 | 3091 | 3457 | |
| load | 1639 | 988 | 2597 | 503 | 2110 | 2440 | |||
| domContentLoaded | 1639 | 988 | 2597 | 503 | 2110 | 2440 | |||
| domInteractive | 131 | 32 | 1001 | 203 | 98 | 910 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 210 | 27 | 1095 | 230 | 237 | 951 | |||
| firstReactRender | 60 | 37 | 113 | 13 | 64 | 84 | |||
| getState | 138 | 46 | 341 | 53 | 161 | 246 | |||
| initialActions | 3 | 1 | 56 | 7 | 2 | 6 | |||
| loadScripts | 1539 | 973 | 2479 | 461 | 1975 | 2272 | |||
| setupStore | 74 | 4 | 1090 | 200 | 54 | 263 | |||
| numNetworkReqs | 75 | 53 | 144 | 23 | 71 | 133 | |||
| Webpack | Standard Home | uiStartup | 1580 | 1317 | 2784 | 216 | 1691 | 2017 | |
| load | 1316 | 1123 | 2448 | 168 | 1372 | 1536 | |||
| domContentLoaded | 1316 | 1123 | 2448 | 168 | 1372 | 1536 | |||
| domInteractive | 71 | 27 | 161 | 32 | 86 | 132 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 63 | 20 | 287 | 47 | 83 | 153 | |||
| firstReactRender | 42 | 32 | 98 | 9 | 45 | 57 | |||
| getState | 19 | 7 | 172 | 28 | 13 | 59 | |||
| initialActions | 1 | 0 | 3 | 0 | 1 | 2 | |||
| loadScripts | 1280 | 1092 | 2426 | 160 | 1337 | 1497 | |||
| setupStore | 16 | 6 | 190 | 24 | 13 | 52 | |||
| numNetworkReqs | 15 | 6 | 81 | 20 | 8 | 73 | |||
| Webpack | Power User Home | uiStartup | 2854 | 1806 | 4639 | 575 | 3226 | 3649 | |
| load | 1923 | 1155 | 2693 | 511 | 2373 | 2625 | |||
| domContentLoaded | 1922 | 1155 | 2693 | 511 | 2373 | 2624 | |||
| domInteractive | 182 | 30 | 1033 | 296 | 127 | 961 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 199 | 21 | 2428 | 308 | 219 | 972 | |||
| firstReactRender | 60 | 39 | 126 | 13 | 64 | 80 | |||
| getState | 141 | 78 | 374 | 51 | 168 | 236 | |||
| initialActions | 3 | 1 | 42 | 6 | 3 | 7 | |||
| loadScripts | 1833 | 1137 | 2669 | 478 | 2260 | 2535 | |||
| setupStore | 52 | 5 | 480 | 80 | 59 | 264 | |||
| numNetworkReqs | 71 | 45 | 127 | 23 | 68 | 120 |
📊 Page Load Benchmark Results
Current Commit: acd22c4 | Date: 12/10/2025
📄 Localhost MetaMask Test Dapp
Samples: 100
Summary
- pageLoadTime-> current mean value: 1.05s (±50ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
- domContentLoaded-> current mean value: 731ms (±45ms) 🟢 | historical mean value: 720ms ⬆️ (historical data)
- firstContentfulPaint-> current mean value: 79ms (±18ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)
📈 Detailed Results
| Metric | Mean | Std Dev | Min | Max | P95 | P99 |
|---|---|---|---|---|---|---|
| pageLoadTime | 1.05s | 50ms | 1.01s | 1.44s | 1.08s | 1.44s |
| domContentLoaded | 731ms | 45ms | 702ms | 1.08s | 759ms | 1.08s |
| firstPaint | 79ms | 18ms | 60ms | 244ms | 88ms | 244ms |
| firstContentfulPaint | 79ms | 18ms | 60ms | 244ms | 88ms | 244ms |
| largestContentfulPaint | 0ms | 0ms | 0ms | 0ms | 0ms | 0ms |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 58 Bytes (0%)
- ui: 1.16 KiB (0.01%)
- common: 20 Bytes (0%)