diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 475a111..8a81a64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,7 +43,7 @@ dependencies: version: 14.1.3(@babel/core@7.24.1)(react-dom@18.2.0)(react@18.2.0) next-i18next: specifier: 15.3.0 - version: 15.3.0(i18next@23.12.1)(next@14.1.3)(react-i18next@13.5.0)(react@18.2.0) + version: 15.3.0(i18next@23.12.1)(next@14.1.3)(react-i18next@15.0.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -1535,6 +1535,13 @@ packages: dependencies: regenerator-runtime: 0.14.1 + /@babel/runtime@7.24.8: + resolution: {integrity: sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.1 + dev: false + /@babel/template@7.24.0: resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} engines: {node: '>=6.9.0'} @@ -5757,7 +5764,7 @@ packages: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.8 dev: false /dayjs@1.11.10: @@ -7438,7 +7445,7 @@ packages: /i18next-browser-languagedetector@7.2.0: resolution: {integrity: sha512-U00DbDtFIYD3wkWsr2aVGfXGAj2TgnELzOX9qv8bT0aJtvPV9CRO77h+vgmHFBMe7LAxdwvT/7VkCWGya6L3tA==} dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.8 dev: false /i18next-fs-backend@2.3.1: @@ -7448,7 +7455,7 @@ packages: /i18next@22.5.1: resolution: {integrity: sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA==} dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.8 dev: false /i18next@23.12.1: @@ -9023,7 +9030,7 @@ packages: resolution: {integrity: sha512-21GQVd0pp2nACoK0C2PL8mBsEhIFUFFntYrWRlYNHtPQoqDzddrPEIgkyaABGXGued+dZoBlFQl+LASlmmfkvw==} engines: {node: '>=18'} dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.8 dev: false /metro-source-map@0.80.6: @@ -9330,7 +9337,7 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: false - /next-i18next@15.3.0(i18next@23.12.1)(next@14.1.3)(react-i18next@13.5.0)(react@18.2.0): + /next-i18next@15.3.0(i18next@23.12.1)(next@14.1.3)(react-i18next@15.0.0)(react@18.2.0): resolution: {integrity: sha512-bq7Cc9XJFcmGOCLnyEtHaeJ3+JJNsI/8Pkj9BaHAnhm4sZ9vNNC4ZsaqYnlRZ7VH5ypSo73fEqLK935jLsmCvQ==} engines: {node: '>=14'} peerDependencies: @@ -9347,7 +9354,7 @@ packages: i18next-fs-backend: 2.3.1 next: 14.1.3(@babel/core@7.24.1)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 - react-i18next: 13.5.0(i18next@23.12.1)(react-dom@18.2.0)(react-native@0.73.6)(react@18.2.0) + react-i18next: 15.0.0(i18next@23.12.1)(react-dom@18.2.0)(react-native@0.73.6)(react@18.2.0) dev: false /next@14.1.3(@babel/core@7.24.1)(react-dom@18.2.0)(react@18.2.0): @@ -10146,7 +10153,7 @@ packages: react-native: optional: true dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.8 html-parse-stringify: 3.0.1 i18next: 22.5.1 react: 18.2.0 @@ -10154,8 +10161,8 @@ packages: react-native: 0.73.6(@babel/core@7.24.1)(@babel/preset-env@7.24.1)(react@18.2.0) dev: false - /react-i18next@13.5.0(i18next@23.12.1)(react-dom@18.2.0)(react-native@0.73.6)(react@18.2.0): - resolution: {integrity: sha512-CFJ5NDGJ2MUyBohEHxljOq/39NQ972rh1ajnadG9BjTk+UXbHLq4z5DKEbEQBDoIhUmmbuS/fIMJKo6VOax1HA==} + /react-i18next@15.0.0(i18next@23.12.1)(react-dom@18.2.0)(react-native@0.73.6)(react@18.2.0): + resolution: {integrity: sha512-2O3IgF4zivg57Q6p6i+ChDgJ371IDcEWbuWC6gvoh5NbkDMs0Q+O7RPr4v61+Se32E0V+LmtwePAeqWZW0bi6g==} peerDependencies: i18next: '>= 23.2.3' react: '>= 16.8.0' @@ -10167,7 +10174,7 @@ packages: react-native: optional: true dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.24.8 html-parse-stringify: 3.0.1 i18next: 23.12.1 react: 18.2.0 diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 41e3090..5451f12 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,5 +1,58 @@ { - "HOME":{ - + "HOME": { + "title": "ZKsync Ecosystem", + "gasPrice": "Gas Price", + "transfer": "ERC-20 Transfer", + "lockedAssets": "Locked assets in shared bridge", + "DASHBOARD": { + "title": "Chain list", + "chain": "Chain", + "chainId": "Chain ID", + "nativeToken": "Native token", + "tvl": "TVL - L1", + "type": "Type", + "search": "Search by chain name or id..." } -} \ No newline at end of file + }, + "CHAINPAGE": { + "website": "Website", + "explorer": "Explorer", + "launchDate": "Launch date", + "environment": "Environment", + "nativeToken": "Native token", + "CHAININFORMATION": { + "title": "Chain information", + "chainType": "Chain type", + "lastBlock": "Last block", + "lastBlockVerified": "Last block verified", + "transactionsPerSecond": "Transactions per second", + "totalBatchesCommitted": "Total batches committed", + "totalBatchesVerified": "Total batches verified", + "averageBlockTime": "Average block time" + }, + "ZKCHAINTVL": { + "title": "ZKchain TVL" + }, + "RPC": { + "title": "RPC", + "status": "Status" + }, + "FEEPARAMS": { + "batch": "Batch Overhead L1 Gas", + "compute": "Compute Overhead Part", + "maxGasBatch": "Max Gas per Batch" + } + }, + "FOOTER": { + "docs": "Documentation", + "github": "GitHub", + "madeWithLove": "Made with ❤️ by" + }, + "DISCLAIMER": { + "disclaimer": "Disclaimer: This application is currently in beta. Please proceed at your own risk. Any funds lost through its use are non-recoverable." + }, + "LOCALES": { + "en": "English", + "es": "Spanish" + } +} diff --git a/public/locales/es/common.json b/public/locales/es/common.json index e69de29..6c8e324 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -0,0 +1,58 @@ +{ + "HOME": { + "title": "Ecosistema ZKsync", + "gasPrice": "Precio del gas", + "transfer": "Transferencia ERC-20", + "lockedAssets": "Activos bloqueados en puente compartido", + "DASHBOARD": { + "title": "Lista de cadenas", + "chain": "Cadena", + "chainId": "ID de cadena", + "nativeToken": "Token nativo", + "tvl": "TVL - L1", + "type": "Tipo", + "search": "Buscar por nombre o ID de la cadena..." + } + }, + "CHAINPAGE": { + "website": "Sitio web", + "explorer": "Explorador", + "launchDate": "Fecha de lanzamiento", + "environment": "Entorno", + "nativeToken": "Token nativo", + "CHAININFORMATION": { + "title": "Información de la cadena", + "chainType": "Tipo de cadena", + "lastBlock": "Último bloque", + "lastBlockVerified": "Último bloque verificado", + "transactionsPerSecond": "Transacciones por segundo", + "totalBatchesCommitted": "Total de lotes comprometidos", + "totalBatchesVerified": "Total de lotes verificados", + "averageBlockTime": "Tiempo promedio de bloque" + }, + "ZKCHAINTVL": { + "title": "TVL de ZKchain" + }, + "RPC": { + "title": "RPC", + "status": "Estado" + }, + "FEEPARAMS": { + "batch": "Sobrecarga de lote L1 Gas", + "compute": "Parte de sobrecarga de cómputo", + "maxGasBatch": "Máximo gas por lote" + } + }, + "FOOTER": { + "docs": "Documentación", + "github": "GitHub", + "madeWithLove": "Hecho con ❤️ por" + }, + "DISCLAIMER": { + "disclaimer": "Advertencia: Esta aplicación está actualmente en beta. Por favor, proceda bajo su propio riesgo. Cualquier fondo perdido a través de su uso no es recuperable." + }, + "LOCALES": { + "en": "Inglés", + "es": "Español" + } +} diff --git a/src/components/Disclaimer.tsx b/src/components/Disclaimer.tsx index 81d4764..d201257 100644 --- a/src/components/Disclaimer.tsx +++ b/src/components/Disclaimer.tsx @@ -1,14 +1,14 @@ import { styled, Box, Typography } from '@mui/material'; +import { useTranslation } from 'next-i18next'; import { DISCLAIMER_HEIGHT } from '~/utils'; export const Disclaimer = () => { + const { t } = useTranslation(); + return ( - - Disclaimer: This application is currently in beta. Please proceed at your own risk. Any funds lost through its - use are non-recoverable. - + {t('DISCLAIMER.disclaimer')} ); }; diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index cd1018e..45d9ef5 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -1,7 +1,11 @@ +import { useTranslation } from 'next-i18next'; + export const SearchBar = () => { + const { t } = useTranslation(); + return (
- +
); }; diff --git a/src/components/Table.tsx b/src/components/Table.tsx index 377796c..0ad112d 100644 --- a/src/components/Table.tsx +++ b/src/components/Table.tsx @@ -1,15 +1,19 @@ +import { useTranslation } from 'next-i18next'; + import { useData } from '~/hooks'; export const Table = () => { + const { t } = useTranslation(); const { ecosystemData } = useData(); + return ( - - - - - + + + + + {ecosystemData?.chains.map((data, index) => { diff --git a/src/components/TitleBanner.tsx b/src/components/TitleBanner.tsx index 36a52f4..3d650d8 100644 --- a/src/components/TitleBanner.tsx +++ b/src/components/TitleBanner.tsx @@ -1,9 +1,14 @@ +import { useTranslation } from 'next-i18next'; + export const TitleBanner = () => { + const { t } = useTranslation(); + return (
- zkSync Ecosystem + {t('HOME.title')} +
- Gas Price: 10 wei · ERC-20 Transfer: $10 + {`${t('HOME.gasPrice')}: 10 wei ${t('HOME.transfer')} $10`}
); diff --git a/src/containers/Dashboard/index.tsx b/src/containers/Dashboard/index.tsx index 2633f45..544d0e1 100644 --- a/src/containers/Dashboard/index.tsx +++ b/src/containers/Dashboard/index.tsx @@ -1,10 +1,14 @@ +import { useTranslation } from 'next-i18next'; + import { SearchBar, Table, Title } from '~/components'; export const Dashboard = () => { + const { t } = useTranslation(); + return (
- + <Title title={t('HOME.DASHBOARD.title')} /> <SearchBar /> </header> <Table /> diff --git a/src/containers/Footer/index.tsx b/src/containers/Footer/index.tsx index 5d98840..45f49cb 100644 --- a/src/containers/Footer/index.tsx +++ b/src/containers/Footer/index.tsx @@ -1,14 +1,17 @@ +import { useTranslation } from 'next-i18next'; import { styled } from '@mui/material/styles'; -import { useCustomTheme } from '~/hooks/useContext/useTheme'; +import { useCustomTheme } from '~/hooks'; import { FOOTER_HEIGHT } from '~/utils'; export const Footer = () => { + const { t } = useTranslation(); + return ( <FooterContainer> <h1>Footer</h1> <Subtitle> - <p>Made with 💜 by</p> + <p>{t('FOOTER.madeWithLove')}</p> <a href='https://defi.sucks'>Wonderland</a> </Subtitle> </FooterContainer> diff --git a/src/containers/LockedAssets/index.tsx b/src/containers/LockedAssets/index.tsx index c365ac0..beb9cc6 100644 --- a/src/containers/LockedAssets/index.tsx +++ b/src/containers/LockedAssets/index.tsx @@ -1,14 +1,17 @@ +import { useTranslation } from 'next-i18next'; + import { TotalValueLocked, Title } from '~/components'; import { useData } from '~/hooks'; export const LockedAssets = () => { + const { t } = useTranslation(); const { ecosystemData } = useData(); return ( <section> {ecosystemData && ( <> - <Title title={`Locked assets in shared bridge: ${ecosystemData.total}`} /> + <Title title={`${t('HOME.lockedAssets')}: ${ecosystemData.total}`} /> <TotalValueLocked tvl={ecosystemData.tvl} /> </> )}
ChainChain IDNative tokenTVL - L1Type{t('HOME.DASHBOARD.chain')}{t('HOME.DASHBOARD.chainId')}{t('HOME.DASHBOARD.nativeToken')}{t('HOME.DASHBOARD.tvl')}{t('HOME.DASHBOARD.type')}