From 87860221cb692b05f5381c6121d9dd58075732ea Mon Sep 17 00:00:00 2001 From: kurt Date: Fri, 17 Jan 2025 11:14:08 +0800 Subject: [PATCH] check unlocalized strings --- messages/en.json | 15 ++++++++++++++- src/routes/[network]/(account)/ram/+layout.ts | 9 +++++---- .../(account)/resources/powerup/+page.ts | 9 +++++---- .../[network]/(account)/resources/rex/+page.ts | 3 ++- .../[network]/(account)/resources/stake/+page.ts | 3 ++- .../(explorer)/block/[number]/+page.svelte | 4 +++- .../[network]/(explorer)/key/[publicKey]/+page.ts | 2 +- .../transaction/[id]/[[seq]]/+layout.ts | 10 +++++++++- .../transaction/[id]/[[seq]]/+page.svelte | 9 +++++---- 9 files changed, 46 insertions(+), 18 deletions(-) diff --git a/messages/en.json b/messages/en.json index 83dfff72..7f480d7f 100644 --- a/messages/en.json +++ b/messages/en.json @@ -46,6 +46,7 @@ "common_complete": "Complete", "common_confirm": "Confirm", "common_connect_wallet": "Connect Wallet", + "common_contract": "Contract", "common_copied_result": "Copied!", "common_copy": "Copy", "common_cpu_total": "Total CPU", @@ -146,6 +147,8 @@ "common_transaction_complete": "Transaction Complete", "common_transaction_error": "Transaction Error", "common_transaction_error_subtitle": "There was an error submitting your transaction.", + "common_transaction_unit_multi": "Transactions", + "common_transaction_unit_single": "Transaction", "common_transfer_to_another_account": "Transfer tokens to another account.", "common_trx_id": "Transaction ID", "common_trx_not_found": "Transaction Not Found", @@ -224,6 +227,7 @@ "homepage_staking_description": "The {network} staking rewards program proportionally distributes 85.6k {token} daily to token holders who have staked their tokens. These tokens can be unstaked and will be usable again after a 21 day lockup period.", "homepage_staking_intro": "Stake {network} today for an estimated {apr}% APR", "homepage_staking_intro_legend": "APR is based on the total amount staked and dynamically changes over time.", + "key_404": "Key not found: {error}", "key_page_description": "A public key associated with {accounts} account(s) on the {network} network.", "key_page_subtitle": "The {accounts} account(s) associated with this public key", "key_page_title": "Public Key", @@ -314,6 +318,8 @@ "ram_metadata_buy_title": "{token}/RAM Market | {network} Network", "ram_metadata_overview_description": "An overview of RAM Market on the {network} network that provides access to buy and sell RAM with {token} using an {network} compatible wallet.", "ram_metadata_sell_description": "Exchange RAM for {token} on the {network} network using an {network} compatible wallet.", + "ram_overview_subtitlle": "An overview of the {token}/RAM market on the {network} Network.", + "ram_overview_titlle": "{token}/RAM Market", "ram_page_sell_subtitle": "Exchange RAM for {token} on the {network} network.", "ram_page_subtitle": "Exchange {token} for RAM on the {network} network.", "ram_purchase_value": "RAM Purchase Value", @@ -326,9 +332,15 @@ "resources_rent_confirm": "Confirm Rent", "resources_rent_confirm_with_cost": "Rent for {cost}", "resources_rent_for_self": "Rent Resources for my account", + "resources_rent_metadata_description": "Rent CPU and NET resources on the {network} Network using an {network} compatible wallet.", + "resources_rent_metadata_title": "Rent Resources | {network} Network", "resources_rent_receiving_placeholder": "Enter the account name", + "resources_rent_renting": "Renting", + "resources_rent_subtitle": "Rent CPU and NET resources on the {network} Network.", + "resources_rent_title": "Rent Resources", "resources_rent_with_powerup": "Rent resources with PowerUp", "resources_rent_with_rex": "Rent resources with REX", + "resources_rent_with_rex_simple": "Rent with Rex", "resources_rent_with_stake": "Stake {symbolName} for resources", "resources_usable_time_24h": "24 Hours", "resources_usable_time_30days": "30 Days", @@ -380,9 +392,10 @@ "token_purchase_providers": "Token Purchase Providers", "tokens_purchase_providers": "Tokens can be purchased directly through the following providers:", "total_proceeds": "Total Proceeds", + "transaction_404": "Transaction not found: {transaction}", "transaction_page_meta_description": "A transaction performed at {date} on the {network} Network.", "transaction_page_meta_title": "{id} | {network} Network", "transaction_page_subtitle": "Transaction on {date}", "unstaking_description": "The tokens currently being unstaked are listed below with the date they become available. These balances will continue to earn rewards until they are withdrawn.", "where_eos_can_be_purchased": "EOS can be purchased through a number of platforms, depending on the users needs and location. Below are some of the most popular options available." -} \ No newline at end of file +} diff --git a/src/routes/[network]/(account)/ram/+layout.ts b/src/routes/[network]/(account)/ram/+layout.ts index 3b354247..6f4eb744 100644 --- a/src/routes/[network]/(account)/ram/+layout.ts +++ b/src/routes/[network]/(account)/ram/+layout.ts @@ -3,18 +3,19 @@ import * as m from '$lib/paraglide/messages'; export const load: LayoutLoad = async ({ parent }) => { const { network } = await parent(); + const token = String(network.chain.systemToken?.symbol.name || m.common_tokens()); return { - title: `${network.chain.systemToken?.symbol.name}/RAM Market`, - subtitle: `An overview of the ${network.chain.systemToken?.symbol.name}/RAM market on the ${network.chain.name} network.`, + title: m.ram_overview_titlle({ token }), + subtitle: m.ram_overview_subtitlle({ token, network: network.chain.name }), pageMetaTags: { title: [ m.ram_metadata_buy_title({ - token: String(network.chain.systemToken?.symbol.name || m.common_tokens()), + token: token, network: network.chain.name }) ].join(' | '), description: m.ram_metadata_overview_description({ - token: String(network.chain.systemToken?.symbol.name || m.common_tokens()), + token: token, network: network.chain.name }) } diff --git a/src/routes/[network]/(account)/resources/powerup/+page.ts b/src/routes/[network]/(account)/resources/powerup/+page.ts index 328f484c..8b1f8811 100644 --- a/src/routes/[network]/(account)/resources/powerup/+page.ts +++ b/src/routes/[network]/(account)/resources/powerup/+page.ts @@ -1,15 +1,16 @@ import { languageTag } from '$lib/paraglide/runtime'; import type { PageLoad } from './$types'; +import * as m from '$lib/paraglide/messages'; export const load: PageLoad = async ({ params, parent }) => { const { network } = await parent(); return { - title: 'Rent Resources', - subtitle: `Rent CPU and NET resources on the ${network.chain.name} network.`, + title: m.resources_rent_title(), + subtitle: m.resources_rent_subtitle({ network: network.chain.name }), backPath: `/${languageTag()}/${params.network}/resources`, pageMetaTags: { - title: `Rent Resources | ${network.chain.name} Network`, - description: `Rent CPU and NET resources on the ${network.chain.name} network using an ${network.chain.name} compatible wallet.` + title: m.resources_rent_metadata_title({ network: network.chain.name }), + description: m.resources_rent_metadata_description({ network: network.chain.name }) } }; }; diff --git a/src/routes/[network]/(account)/resources/rex/+page.ts b/src/routes/[network]/(account)/resources/rex/+page.ts index 1796d94e..46082cb9 100644 --- a/src/routes/[network]/(account)/resources/rex/+page.ts +++ b/src/routes/[network]/(account)/resources/rex/+page.ts @@ -1,9 +1,10 @@ import { languageTag } from '$lib/paraglide/runtime'; import type { PageLoad } from './$types'; +import * as m from '$lib/paraglide/messages'; export const load: PageLoad = ({ params }) => { return { - subtitle: 'Rent with Rex', + subtitle: m.resources_rent_with_rex_simple(), backPath: `/${languageTag()}/${params.network}/resources` }; }; diff --git a/src/routes/[network]/(account)/resources/stake/+page.ts b/src/routes/[network]/(account)/resources/stake/+page.ts index 2611a5a7..5480b6a0 100644 --- a/src/routes/[network]/(account)/resources/stake/+page.ts +++ b/src/routes/[network]/(account)/resources/stake/+page.ts @@ -1,9 +1,10 @@ import { languageTag } from '$lib/paraglide/runtime'; import type { PageLoad } from './$types'; +import * as m from '$lib/paraglide/messages'; export const load: PageLoad = ({ params }) => { return { - subtitle: 'Renting', + subtitle: m.resources_rent_renting(), backPath: `/${languageTag()}/${params.network}/resources` }; }; diff --git a/src/routes/[network]/(explorer)/block/[number]/+page.svelte b/src/routes/[network]/(explorer)/block/[number]/+page.svelte index 1a8e7eba..d61ad79e 100644 --- a/src/routes/[network]/(explorer)/block/[number]/+page.svelte +++ b/src/routes/[network]/(explorer)/block/[number]/+page.svelte @@ -40,7 +40,9 @@

{transactions.length} - {transactions.length === 1 ? 'Transaction' : 'Transactions'} + {transactions.length === 1 + ? m.common_transaction_unit_single() + : m.common_transaction_unit_multi()}

{#if transactions.length} diff --git a/src/routes/[network]/(explorer)/key/[publicKey]/+page.ts b/src/routes/[network]/(explorer)/key/[publicKey]/+page.ts index bce04aaa..09846b01 100644 --- a/src/routes/[network]/(explorer)/key/[publicKey]/+page.ts +++ b/src/routes/[network]/(explorer)/key/[publicKey]/+page.ts @@ -10,7 +10,7 @@ export const load: PageLoad = async ({ fetch, params, parent }) => { pubkey = PublicKey.from(String(params.publicKey)); } catch (e) { error(404, { - message: `Key not found: ${e}`, + message: m.key_404({ error: String(e) }), code: 'KEY_NOT_FOUND' }); } diff --git a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.ts b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.ts index 7f2bb196..a45c859d 100644 --- a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.ts +++ b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+layout.ts @@ -1,11 +1,19 @@ import { truncateCenter } from '$lib/utils'; -import type { Load } from '@sveltejs/kit'; +import { error, type Load } from '@sveltejs/kit'; import * as m from '$lib/paraglide/messages'; export const load: Load = async ({ fetch, params, parent }) => { const { network } = await parent(); const response = await fetch(`/${params.network}/api/transaction/${params.id}`); const json = await response.json(); + if (!json?.transaction?.id) { + error(404, { + message: m.transaction_404({ + transaction: truncateCenter(params.id || '', 14) + }), + code: 'NOT_FOUND' + }); + } return { ...json, title: `${truncateCenter(json.transaction.id, 14)}`, diff --git a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+page.svelte b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+page.svelte index 989f60e6..7a7bdeb8 100644 --- a/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+page.svelte +++ b/src/routes/[network]/(explorer)/transaction/[id]/[[seq]]/+page.svelte @@ -1,5 +1,6 @@