Skip to content

Commit

Permalink
🌐 add missing translations
Browse files Browse the repository at this point in the history
  • Loading branch information
sebipap committed Sep 29, 2023
1 parent b5f1193 commit db0df81
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 27 deletions.
2 changes: 1 addition & 1 deletion components/getEXA/ReviewRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ReviewRoute = () => {
</Typography>
<Box display="flex" flexDirection="column" gap={0.5}>
<Box display="flex" gap={0.5} alignItems="center">
{<Image width={24} height={24} src={asset.logoURI || ''} alt="EXA" />}
<Image width={24} height={24} src={asset.logoURI || ''} alt={asset.symbol} />
<Typography fontSize={19} fontWeight={500}>
{formatNumber(qtyIn)} {asset.symbol}
</Typography>
Expand Down
12 changes: 8 additions & 4 deletions components/getEXA/Route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Route = ({ route, tags }: Props) => {
<Box display="flex" flexDirection="column">
<Box display="flex" alignItems="center" gap={2}>
<Box display="flex" gap={0.5}>
<Typography fontWeight={600}> {protocol?.displayName}</Typography>{' '}
<Typography fontWeight={600}> {protocol?.displayName}</Typography>
{serviceTime && <Typography fontWeight={400}> ~ {Math.round(serviceTime / 60)} min</Typography>}
</Box>
<Box display="flex" gap={1}>
Expand All @@ -66,15 +66,19 @@ const Route = ({ route, tags }: Props) => {
bgcolor={tag === 'fastest' ? '#33CC59' : '#0095FF'}
>
<Typography variant="chip" color="components.bg">
{t(tag.toUpperCase())}
{tag === 'fastest' ? t('FASTEST') : t('BEST RETURN')}
</Typography>
</Box>
))}
</Box>
</Box>
<Box display="flex" gap={0.5}>
<Typography fontSize={12}>Est. Output: {formatNumber(Number(toAmount) / 1e18)} EXA</Typography>
<Typography fontSize={12}>Gas fees: ${formatNumber(totalGasFeesInUsd)}</Typography>
<Typography fontSize={12}>
{t('Est. Output')}: {formatNumber(Number(toAmount) / 1e18)} EXA
</Typography>
<Typography fontSize={12}>
{t('Gas fees')}: ${formatNumber(totalGasFeesInUsd)}
</Typography>
</Box>
</Box>
</Box>
Expand Down
4 changes: 3 additions & 1 deletion components/getEXA/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import React, { Box, Skeleton } from '@mui/material';
import { useGetEXA } from 'contexts/GetEXAContext';
import { memo } from 'react';
import Route from './Route';
import { useTranslation } from 'react-i18next';

const Routes = () => {
const { routes } = useGetEXA();
const { t } = useTranslation();

const fastestRouteId = routes?.sort(
(r1, r2) => (r1.userTxs[0].serviceTime || 0) - (r2.userTxs[0].serviceTime || 0),
Expand All @@ -30,7 +32,7 @@ const Routes = () => {
/>
))
) : (
'no routes'
t('No routes')
)}
</Box>
);
Expand Down
2 changes: 1 addition & 1 deletion components/getEXA/SelectRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const SelectRoute = () => {
)}
{exaBalance !== undefined ? (
<Typography ml="auto" color="grey.400" fontWeight={400} whiteSpace="nowrap">
Balance: {formatNumber(formatUnits(exaBalance, 18))}
{t('Balance')}: {formatNumber(formatUnits(exaBalance, 18))}
</Typography>
) : (
<Skeleton width={200} />
Expand Down
3 changes: 0 additions & 3 deletions contexts/GetEXAContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
const [activeRoutes, setActiveRoutes] = useState<ContextValues['activeRoutes']>();
const [bridgeStatus, setBridgeStatus] = useState<ContextValues['bridgeStatus']>();

// const { chain: activeChain } = useNetwork();
const { walletAddress, opts, chain: appChain } = useWeb3();

const { data: walletClient } = useWalletClient({ chainId: chain?.chainId });
const { t } = useTranslation();
const swapper = useSwapper();
Expand Down Expand Up @@ -281,7 +279,6 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
}).then(splitSignature);

const permit = {
// owner: walletAddress,
value,
deadline,
...{ v, r: r as Hex, s: s as Hex },
Expand Down
13 changes: 8 additions & 5 deletions i18n/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"Add tokens to Metamask": "Añadir tokens a Metamask",
"Mint": "Mint",
"Borrow Limit": "Límite de Préstamo",
"Slippage Tolerance": "Tolerancia de Slippage",
"Slippage Tolerance": "Tolerancia de ",
"Pool Utilization Rate": "Tasa de Utilización del Pool",
"Your Health Factor": "Tu Factor de Salud",
"Total deposits": "Depósitos totales",
Expand Down Expand Up @@ -481,10 +481,10 @@
"On connected wallet": "En billetera conectada",
"Delegated to": "Delegado a",
"Transaction Summary": "Resumen de la Transacción",
"Estimated Output": "Salida Estimada",
"Estimated Output": "Monto Estimado",
"Dex": "Dex",
"Gas Fee": "Tarifa de Gas",
"Swap Slippage": "Deslizamiento de Swap",
"Swap Slippage": "Tolerancia para el Swap",
"Confirm": "Confirmar",
"in": "en",
"Get EXA": "Obtener EXA",
Expand All @@ -503,6 +503,9 @@
"Error approving token": "Error al aprobar token",
"Ready to take part in the Protocol's Governance, Vesting Program, or simply hold EXA? Begin by getting EXA today.": "¿Listo para participar en la Gobernanza del Protocolo, el Programa de Vencimiento o simplemente mantener EXA? Comienza obteniendo EXA hoy.",
"GET": "OBTENER",
"Getting EXA gives you the ability to make the most of the Protocol's offerings, actively engaging in \t": "Obtener EXA te brinda la capacidad de aprovechar al máximo las ofertas del Protocolo, participando activamente en él. \t",
", or joining the community as an EXA holder.": ", o unirte a la comunidad como poseedor de EXA."
"FASTEST": "MÁS RÁPIDO",
"BEST RETURN": "MEJOR RETORNO",
"Est. Output": "Monto Estimado",
"Gas fees": "Costo de la transacción",
"No routes": "No hay rutas"
}
29 changes: 17 additions & 12 deletions pages/get-exa.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { NextPage } from 'next';
import { Box, Typography } from '@mui/material';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import { GetEXAProvider } from '../contexts/GetEXAContext';
import { usePageView } from '../hooks/useAnalytics';
import GetEXA from '../components/getEXA';
Expand All @@ -18,18 +18,23 @@ const GetExaPage: NextPage = () => {
{t(`Get EXA`)}
</Typography>
<Typography fontWeight={500} fontSize={16} mb={5}>
{t(`Getting EXA gives you the ability to make the most of the Protocol's offerings, actively engaging in `)}
<Link
href="/governance"
target="_blank"
rel="noopener noreferrer"
style={{
textDecoration: 'underline',
<Trans
i18nKey="Getting EXA gives you the ability to make the most of the Protocol's offerings, actively engaging in <a>Governance</a>, or joining the community as an EXA holder."
components={{
a: (
<Link
href="/governance"
target="_blank"
rel="noopener noreferrer"
style={{
textDecoration: 'underline',
}}
>
{t('Governance')}
</Link>
),
}}
>
Governance
</Link>
{t(`, or joining the community as an EXA holder.`)}
/>
</Typography>
<GetEXAProvider>
<GetEXA />
Expand Down

0 comments on commit db0df81

Please sign in to comment.