From acc8f4869ae7f46a5325d1e3386c8f42923b0748 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Tue, 2 Apr 2024 16:19:10 +0700 Subject: [PATCH] add translations --- src/canvas/JoinPool/Overview/Addresses.tsx | 2 +- src/canvas/JoinPool/Overview/Roles.tsx | 15 ++++++++++----- src/canvas/JoinPool/Overview/Stats.tsx | 6 ++++-- src/library/Form/ClaimPermissionInput/index.tsx | 4 ++-- src/locale/cn/library.json | 5 ++++- src/locale/en/library.json | 5 ++++- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/canvas/JoinPool/Overview/Addresses.tsx b/src/canvas/JoinPool/Overview/Addresses.tsx index 710417eebb..8a8cc93a27 100644 --- a/src/canvas/JoinPool/Overview/Addresses.tsx +++ b/src/canvas/JoinPool/Overview/Addresses.tsx @@ -15,7 +15,7 @@ export const Addresses = ({ return ( -

{t('poolAddresses')}

+

{t('addresses')}

diff --git a/src/canvas/JoinPool/Overview/Roles.tsx b/src/canvas/JoinPool/Overview/Roles.tsx index b9e63de2f9..cc3f2a89a6 100644 --- a/src/canvas/JoinPool/Overview/Roles.tsx +++ b/src/canvas/JoinPool/Overview/Roles.tsx @@ -7,8 +7,10 @@ import { ButtonHelp } from 'kits/Buttons/ButtonHelp'; import { useHelp } from 'contexts/Help'; import { AddressSection } from './AddressSection'; import type { OverviewSectionProps } from '../types'; +import { useTranslation } from 'react-i18next'; export const Roles = ({ bondedPool }: OverviewSectionProps) => { + const { t } = useTranslation('pages'); const { openHelp } = useHelp(); return ( @@ -16,31 +18,34 @@ export const Roles = ({ bondedPool }: OverviewSectionProps) => {

- Pool Roles + {t('pools.roles')} openHelp('Pool Roles')} />

{bondedPool.roles.root && ( - + )} {bondedPool.roles.nominator && ( )} {bondedPool.roles.bouncer && ( )} {bondedPool.roles.depositor && ( )} diff --git a/src/canvas/JoinPool/Overview/Stats.tsx b/src/canvas/JoinPool/Overview/Stats.tsx index 31c19b05e9..5281c2debd 100644 --- a/src/canvas/JoinPool/Overview/Stats.tsx +++ b/src/canvas/JoinPool/Overview/Stats.tsx @@ -8,8 +8,10 @@ import { useApi } from 'contexts/Api'; import BigNumber from 'bignumber.js'; import { useEffect, useState } from 'react'; import type { OverviewSectionProps } from '../types'; +import { useTranslation } from 'react-i18next'; export const Stats = ({ bondedPool }: OverviewSectionProps) => { + const { t } = useTranslation('library'); const { networkData: { units, @@ -50,14 +52,14 @@ export const Stats = ({ bondedPool }: OverviewSectionProps) => { return (

- Actively Nominating + {t('activelyNominating')} {!poolBalance ? `...` : planckToUnit(poolBalance, units).decimalPlaces(3).toFormat()}{' '} - {unit} Bonded + {unit} {t('bonded')}

diff --git a/src/library/Form/ClaimPermissionInput/index.tsx b/src/library/Form/ClaimPermissionInput/index.tsx index 2c81feaa6c..ac87b2c324 100644 --- a/src/library/Form/ClaimPermissionInput/index.tsx +++ b/src/library/Form/ClaimPermissionInput/index.tsx @@ -27,9 +27,9 @@ export const ClaimPermissionInput = ({ description: t('allowAnyoneCompound'), }, { - label: 'Permissioned', + label: t('permissioned'), value: 'Permissioned', - description: 'Only you can claim rewards.', + description: t('permissionedSubtitle'), }, ]; diff --git a/src/locale/cn/library.json b/src/locale/cn/library.json index 4e10c2f938..aecdb13a23 100644 --- a/src/locale/cn/library.json +++ b/src/locale/cn/library.json @@ -9,10 +9,12 @@ "activePools": "活跃提名池", "activeValidator": "活跃验证人", "activeValidators": "活跃验证人", + "activelyNominating": "Actively Nominating", "add": "添加", "addFromFavorites": "从收藏夹添加", "address": "地址", "addressCopiedToClipboard": "复制到剪贴板的地址", + "addresses": "Addresses", "all": "全部", "allowAll": "允许所有", "allowAnyoneCompound": "允许任何人代表您复利收益", @@ -41,6 +43,8 @@ "chooseValidators": "最多能选择 {{maxNominations}} 个验证人。", "chooseValidators2": "自动生成提名或手动加入提名", "claimSetting": "Claim Setting", + "permissioned": "Permissioned", + "permissionedSubtitle": "Only you can claim rewards.", "clear": "清除", "clearSelection": "清除选择", "clickToReload": "重新加载", @@ -152,7 +156,6 @@ "permissionlessClaimingTurnedOff": "己许可申领己关闭", "points": "点数", "pool": "提名池", - "poolAddresses": "Pool Addresses", "poolClaim": "提名池申领", "poolCommission": "提名池佣金", "poolId": "提名池ID", diff --git a/src/locale/en/library.json b/src/locale/en/library.json index fdc01ea748..d2f4940d73 100644 --- a/src/locale/en/library.json +++ b/src/locale/en/library.json @@ -9,10 +9,12 @@ "activePools": "Active Pools", "activeValidator": "Active Validator", "activeValidators": "Active Validators", + "activelyNominating": "Actively Nominating", "add": "Add", "addFromFavorites": "Add From Favorites", "address": "Address", "addressCopiedToClipboard": "Address Copied to Clipboard", + "addresses": "Addresses", "all": "All", "allowAll": "Allow All", "allowAnyoneCompound": "Allow anyone to compound your rewards.", @@ -43,6 +45,8 @@ "claimSetting": "Claim Setting", "clear": "Clear", "clearSelection": "clear selection", + "permissioned": "Permissioned", + "permissionedSubtitle": "Only you can claim rewards.", "clickToReload": "Click to reload", "complete": "Complete", "confirm": "Confirm", @@ -154,7 +158,6 @@ "permissionlessClaimingTurnedOff": "Permissionless claiming is turned off.", "points": "Points", "pool": "Pool", - "poolAddresses": "Pool Addresses", "poolClaim": "Pool Claim", "poolCommission": "Pool Commission", "poolId": "Pool ID",