diff --git a/apps/trading/client-pages/referrals/apply-code-form.tsx b/apps/trading/client-pages/referrals/apply-code-form.tsx index 3f3c63a17..8f3262008 100644 --- a/apps/trading/client-pages/referrals/apply-code-form.tsx +++ b/apps/trading/client-pages/referrals/apply-code-form.tsx @@ -81,7 +81,7 @@ export const ApplyCodeForm = () => { if (!res) { setError('code', { type: 'required', - message: 'The transaction could not be sent', + message: t('The transaction could not be sent'), }); } if (res) { @@ -98,7 +98,7 @@ export const ApplyCodeForm = () => { message: err instanceof Error ? err.message - : 'Your code has been rejected', + : t('Your code has been rejected'), }); } }); @@ -152,7 +152,7 @@ export const ApplyCodeForm = () => { {' '} - Code applied + {t('Code applied')} ); @@ -162,7 +162,7 @@ export const ApplyCodeForm = () => { if (!pubKey) { return { disabled: false, - children: 'Connect wallet', + children: t('Connect wallet'), type: 'button' as ButtonHTMLAttributes['type'], onClick: ((event) => { event.preventDefault(); @@ -174,7 +174,7 @@ export const ApplyCodeForm = () => { if (isReadOnly) { return { disabled: true, - children: 'Apply a code', + children: t('Apply a code'), type: 'submit' as ButtonHTMLAttributes['type'], }; } @@ -182,14 +182,14 @@ export const ApplyCodeForm = () => { if (status === 'requested') { return { disabled: true, - children: 'Confirm in wallet...', + children: t('Confirm in wallet...'), type: 'submit' as ButtonHTMLAttributes['type'], }; } return { disabled: false, - children: 'Apply a code', + children: t('Apply a code'), type: 'submit' as ButtonHTMLAttributes['type'], }; }; @@ -198,10 +198,10 @@ export const ApplyCodeForm = () => { <>

- Apply a referral code + {t('Apply a referral code')}

- Enter a referral code to get trading discounts. + {t('Enter a referral code to get trading discounts.')}

{ onSubmit={handleSubmit(onSubmit)} >
diff --git a/apps/trading/client-pages/referrals/how-it-works-table.tsx b/apps/trading/client-pages/referrals/how-it-works-table.tsx index 453ee09b7..9fdc3acd6 100644 --- a/apps/trading/client-pages/referrals/how-it-works-table.tsx +++ b/apps/trading/client-pages/referrals/how-it-works-table.tsx @@ -1,3 +1,4 @@ +import { t } from '@vegaprotocol/i18n'; import { Table } from './table'; export const HowItWorksTable = () => ( @@ -13,7 +14,9 @@ export const HowItWorksTable = () => ( 1 ), - step: 'Referrers generate a code assigned to their key via an on chain transaction', + step: t( + 'Referrers generate a code assigned to their key via an on chain transaction' + ), }, { number: ( @@ -21,7 +24,9 @@ export const HowItWorksTable = () => ( 2 ), - step: 'Anyone with the referral link can apply it to their key(s) of choice via an on chain transaction', + step: t( + 'Anyone with the referral link can apply it to their key(s) of choice via an on chain transaction' + ), }, { number: ( @@ -29,7 +34,9 @@ export const HowItWorksTable = () => ( 3 ), - step: 'Discounts are applied automatically during trading based on the key(s) used', + step: t( + 'Discounts are applied automatically during trading based on the key(s) used' + ), }, { number: ( @@ -37,7 +44,9 @@ export const HowItWorksTable = () => ( 4 ), - step: 'Referrers earn commission based on a percentage of the taker fees their referees pay', + step: t( + 'Referrers earn commission based on a percentage of the taker fees their referees pay' + ), }, { number: ( @@ -45,7 +54,9 @@ export const HowItWorksTable = () => ( 5 ), - step: 'The commission is taken from the infrastructure fee, maker fee, and liquidity provider fee, not from the referee', + step: t( + 'The commission is taken from the infrastructure fee, maker fee, and liquidity provider fee, not from the referee' + ), }, ]} > diff --git a/apps/trading/client-pages/referrals/landing-banner.tsx b/apps/trading/client-pages/referrals/landing-banner.tsx index 56331b34e..9af23c0b9 100644 --- a/apps/trading/client-pages/referrals/landing-banner.tsx +++ b/apps/trading/client-pages/referrals/landing-banner.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; import { AnimatedDudeWithWire } from './graphics/dude'; +import { t } from '@vegaprotocol/i18n'; export const LandingBanner = () => { return ( @@ -13,16 +14,17 @@ export const LandingBanner = () => {

- Earn commission & stake rewards + {t('Earn commission & stake rewards')}

- Invite friends and earn commission in the form of Vega rewards from - the trading fees they pay. Stake those rewards to earn multipliers - on future rewards. + {t( + 'Invite friends and earn commission in the form of Vega rewards from the trading fees they pay. Stake those rewards to earn multipliers on future rewards.' + )}

- Any friends that join using the code will receive discounts off - trading fees. + {t( + 'Any friends that join using the code will receive discounts off trading fees.' + )}

diff --git a/apps/trading/client-pages/referrals/referral-statistics.tsx b/apps/trading/client-pages/referrals/referral-statistics.tsx index b39f36ff6..6112b60a0 100644 --- a/apps/trading/client-pages/referrals/referral-statistics.tsx +++ b/apps/trading/client-pages/referrals/referral-statistics.tsx @@ -26,6 +26,7 @@ import sortBy from 'lodash/sortBy'; import { useLayoutEffect, useRef, useState } from 'react'; import { useCurrentEpochInfoQuery } from './hooks/__generated__/Epoch'; import BigNumber from 'bignumber.js'; +import { t } from '@vegaprotocol/i18n'; export const ReferralStatistics = () => { const { pubKey } = useVegaWallet(); @@ -116,34 +117,34 @@ export const Statistics = ({ : 0; const baseCommissionTile = ( - + {baseCommissionValue * 100}% ); const stakingMultiplierTile = ( - {multiplier || 'None'} + {multiplier || t('None')} ); const finalCommissionTile = ( - + {finalCommissionValue * 100}% ); const numberOfTradersValue = data.referees.length; const numberOfTradersTile = ( - {numberOfTradersValue} + {numberOfTradersValue} ); const codeTile = ; const createdAtTile = ( - + {getDateFormat().format(new Date(data.createdAt))} @@ -154,7 +155,10 @@ export const Statistics = ({ .map((r) => new BigNumber(r.totalRefereeGeneratedRewards)) .reduce((all, r) => all.plus(r), new BigNumber(0)); const totalCommissionTile = ( - + {getNumberFormat(0).format(Number(totalCommissionValue))} ); @@ -184,29 +188,31 @@ export const Statistics = ({ }); const currentBenefitTierTile = ( - + {currentBenefitTierValue?.tier || '-'} ); const discountFactorTile = ( - {discountFactorValue * 100}% + {discountFactorValue * 100}% ); const runningVolumeTile = ( - + {compactNumFormat.format(runningVolumeValue)} ); - const epochsTile = {epochsValue}; + const epochsTile = ( + {epochsValue} + ); const nextTierVolumeTile = ( - + {nextBenefitTierVolumeValue <= 0 - ? '-' + ? '0' : compactNumFormat.format(nextBenefitTierVolumeValue)} ); const nextTierEpochsTile = ( - - {nextBenefitTierEpochsValue <= 0 ? '-' : nextBenefitTierEpochsValue} + + {nextBenefitTierEpochsValue <= 0 ? '0' : nextBenefitTierEpochsValue} ); @@ -249,7 +255,7 @@ export const Statistics = ({ {/* Referees (only for referrer view) */} {as === 'referrer' && data.referees.length > 0 && (
-

Referees

+

{t('Referees')}

(
- I want a code + {t('I want a code')} - I have a code + {t('I have a code')}
); @@ -77,7 +77,7 @@ export const Referrals = () => {
) : error ? (
-

Something went wrong

+

{t('Something went wrong')}

{error.message}
) : ( @@ -88,7 +88,7 @@ export const Referrals = () => {
-

How it works

+

{t('How it works')}

@@ -98,7 +98,8 @@ export const Referrals = () => { href={REFERRAL_DOCS_LINK} target="_blank" > - Read the terms + {t('Read the terms')}{' '} +
diff --git a/apps/trading/client-pages/referrals/tiers.tsx b/apps/trading/client-pages/referrals/tiers.tsx index 73f3831c2..e6045c2bb 100644 --- a/apps/trading/client-pages/referrals/tiers.tsx +++ b/apps/trading/client-pages/referrals/tiers.tsx @@ -7,6 +7,7 @@ import { Tag } from './tag'; import type { ComponentProps, ReactNode } from 'react'; import { ExternalLink } from '@vegaprotocol/ui-toolkit'; import { DApp, TOKEN_PROPOSALS, useLinks } from '@vegaprotocol/environment'; +import { t } from '@vegaprotocol/i18n'; const Loading = ({ variant }: { variant: 'large' | 'inline' }) => (
Multiplier {referralRewardMultiplier}x

{label}

- Stake a minimum of {minimumStakedTokens} $VEGA tokens + {t('Stake a minimum of')} {minimumStakedTokens} {t('$VEGA tokens')}

@@ -81,9 +82,12 @@ export const TiersContainer = () => { if ((!loading && !details) || error) { return (
- We're sorry but we don't have an active referral programme - currently running. You can propose a new programme{' '} - here + {t( + "We're sorry but we don't have an active referral programme currently running. You can propose a new programme" + )}{' '} + + {t('here')} + .
); @@ -93,10 +97,10 @@ export const TiersContainer = () => { <> {/* Benefit tiers */}
-

Referral tiers

+

{t('Referral tiers')}

{ends && ( - Program ends: {ends} + {t('Program ends:')} {ends} )}
@@ -119,7 +123,7 @@ export const TiersContainer = () => { {/* Staking tiers */}
-

Staking multipliers

+

{t('Staking multipliers')}

{loading || !stakingTiers || stakingTiers.length === 0 ? ( @@ -170,15 +174,15 @@ const TiersTable = ({ return ( ({ ...d,