From 070ee10fb063677cddb0cc930adac88d020b57e0 Mon Sep 17 00:00:00 2001 From: softsimon Date: Mon, 13 Mar 2023 17:08:27 +0900 Subject: [PATCH] Fixing more missing i18n keys fixes #3339 fixes #3337 --- .../pool-ranking/pool-ranking.component.ts | 13 ++-- .../nodes-per-country-chart.component.ts | 10 +-- .../nodes-per-isp-chart.component.ts | 10 +-- .../lightning-statistics-chart.component.ts | 2 +- frontend/src/locale/messages.xlf | 62 +++++++++++++++---- 5 files changed, 71 insertions(+), 26 deletions(-) diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts index 0f2103024..a5349ee7c 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts @@ -162,10 +162,10 @@ export class PoolRankingComponent implements OnInit { if (this.miningWindowPreference === '24h') { return `${pool.name} (${pool.share}%)
` + pool.lastEstimatedHashrate.toString() + ' PH/s' + - `
` + $localize`${i} blocks`; + `
` + $localize`:@@1bb6965f8e1bbe40c076528ffd841da86f57f119:${ i }:INTERPOLATION: blocks`; } else { return `${pool.name} (${pool.share}%)
` + - $localize`${i} blocks`; + $localize`:@@1bb6965f8e1bbe40c076528ffd841da86f57f119:${ i }:INTERPOLATION: blocks`; } } }, @@ -195,13 +195,14 @@ export class PoolRankingComponent implements OnInit { }, borderColor: '#000', formatter: () => { + const percentage = totalShareOther.toFixed(2) + '%'; if (this.miningWindowPreference === '24h') { - return `${'Other'} (${totalShareOther.toFixed(2)}%)
` + + return `` + $localize`Other (${percentage})` + `
` + totalEstimatedHashrateOther.toString() + ' PH/s' + - `
` + totalBlockOther.toString() + ` blocks`; + `
` + $localize`:@@1bb6965f8e1bbe40c076528ffd841da86f57f119:${ totalBlockOther.toString() }:INTERPOLATION: blocks`; } else { - return `${'Other'} (${totalShareOther.toFixed(2)}%)
` + - totalBlockOther.toString() + ` blocks`; + return `` + $localize`Other (${percentage})` + `
` + + $localize`:@@1bb6965f8e1bbe40c076528ffd841da86f57f119:${ totalBlockOther.toString() }:INTERPOLATION: blocks`; } } }, diff --git a/frontend/src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts b/frontend/src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts index 681688842..b4621d7bf 100644 --- a/frontend/src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts +++ b/frontend/src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts @@ -99,8 +99,9 @@ export class NodesPerCountryChartComponent implements OnInit { }, borderColor: '#000', formatter: () => { + const nodeCount = country.count.toString(); return `${country.name.en} (${country.share}%)
` + - $localize`${country.count.toString()} nodes` + `
` + + $localize`${nodeCount} nodes` + `
` + $localize`${this.amountShortenerPipe.transform(country.capacity / 100000000, 2)} BTC capacity` ; } @@ -115,7 +116,7 @@ export class NodesPerCountryChartComponent implements OnInit { color: 'grey', }, value: totalShareOther, - name: 'Other' + (this.isMobile() ? `` : ` (${totalShareOther.toFixed(2)}%)`), + name: $localize`Other (${totalShareOther.toFixed(2) + '%'})`, label: { overflow: 'truncate', color: '#b1b1b1', @@ -131,8 +132,9 @@ export class NodesPerCountryChartComponent implements OnInit { }, borderColor: '#000', formatter: () => { - return `${'Other'} (${totalShareOther.toFixed(2)}%)
` + - totalNodeOther.toString() + ` nodes`; + const nodeCount = totalNodeOther.toString(); + return `` + $localize`Other (${totalShareOther.toFixed(2) + '%'})` + `
` + + $localize`${nodeCount} nodes`; }, }, data: 9999 as any diff --git a/frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts b/frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts index caaa350d6..614704ed6 100644 --- a/frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts +++ b/frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts @@ -153,8 +153,9 @@ export class NodesPerISPChartComponent implements OnInit { }, borderColor: '#000', formatter: () => { + const nodeCount = isp[4].toString(); return `${isp[1]} (${this.sortBy === 'capacity' ? isp[7] : isp[6]}%)
` + - $localize`${isp[4].toString()} nodes` + `
` + + $localize`${nodeCount} nodes` + `
` + $localize`${this.amountShortenerPipe.transform(isp[2] / 100000000, 2)} BTC` ; } @@ -169,7 +170,7 @@ export class NodesPerISPChartComponent implements OnInit { color: 'grey', }, value: totalShareOther, - name: 'Other' + (isMobile() || this.widget ? `` : ` (${totalShareOther.toFixed(2)}%)`), + name: $localize`Other (${totalShareOther.toFixed(2) + '%'})`, label: { overflow: 'truncate', color: '#b1b1b1', @@ -185,8 +186,9 @@ export class NodesPerISPChartComponent implements OnInit { }, borderColor: '#000', formatter: () => { - return `Other (${totalShareOther.toFixed(2)}%)
` + - $localize`${nodeCountOther.toString()} nodes` + `
` + + const nodeCount = nodeCountOther.toString(); + return `` + $localize`Other (${totalShareOther.toFixed(2) + '%'})` + `
` + + $localize`${nodeCount} nodes` + `
` + $localize`${this.amountShortenerPipe.transform(capacityOther / 100000000, 2)} BTC`; } }, diff --git a/frontend/src/app/lightning/statistics-chart/lightning-statistics-chart.component.ts b/frontend/src/app/lightning/statistics-chart/lightning-statistics-chart.component.ts index b93ee1f3d..dd034eabd 100644 --- a/frontend/src/app/lightning/statistics-chart/lightning-statistics-chart.component.ts +++ b/frontend/src/app/lightning/statistics-chart/lightning-statistics-chart.component.ts @@ -256,7 +256,7 @@ export class LightningStatisticsChartComponent implements OnInit { series: data.channel_count.length === 0 ? [] : [ { zlevel: 1, - name: 'Channels', + name: $localize`:@@807cf11e6ac1cde912496f764c176bdfdd6b7e19:Channels`, showSymbol: false, symbol: 'none', data: data.channel_count, diff --git a/frontend/src/locale/messages.xlf b/frontend/src/locale/messages.xlf index 3e1521b92..b74f94c26 100644 --- a/frontend/src/locale/messages.xlf +++ b/frontend/src/locale/messages.xlf @@ -2919,6 +2919,22 @@ src/app/components/mempool-blocks/mempool-blocks.component.html 35,36 + + src/app/components/pool-ranking/pool-ranking.component.ts + 165,163 + + + src/app/components/pool-ranking/pool-ranking.component.ts + 168,167 + + + src/app/components/pool-ranking/pool-ranking.component.ts + 202,200 + + + src/app/components/pool-ranking/pool-ranking.component.ts + 205,204 + src/app/lightning/channel/channel-box/channel-box.component.html 78 @@ -3709,15 +3725,31 @@ 58 - - blocks + + Other () src/app/components/pool-ranking/pool-ranking.component.ts - 165,163 + 200 src/app/components/pool-ranking/pool-ranking.component.ts - 168,167 + 204 + + + src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts + 119,114 + + + src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts + 136 + + + src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts + 173,168 + + + src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts + 190 @@ -5802,6 +5834,10 @@ src/app/lightning/statistics-chart/lightning-statistics-chart.component.ts 194,193 + + src/app/lightning/statistics-chart/lightning-statistics-chart.component.ts + 259,257 + lightning.channels @@ -6242,25 +6278,29 @@ lightning.share - nodes + nodes src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts - 103,102 + 104,103 + + + src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts + 137,136 src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts - 157,156 + 158,157 src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts - 189,188 + 191,190 BTC capacity src/app/lightning/nodes-per-country-chart/nodes-per-country-chart.component.ts - 104,102 + 105,103 @@ -6366,11 +6406,11 @@ BTC src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts - 158,156 + 159,157 src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts - 190,188 + 192,190