Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: i18n set up #6

Merged
merged 13 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-undef */

const path = require('path');

module.exports = {
i18n: {
locales: ['en', 'es'],
defaultLocale: 'en',
},
localePath: typeof window === 'undefined' ? path.resolve('./public/locales') : '/locales',
};
8 changes: 7 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

const nextConfig = {
i18n: {
locales: ['en', 'es'],
defaultLocale: 'en',
},
};

export default nextConfig;
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "web3-react-boilerplate",
"name": "ZKchainHub",
"private": true,
"version": "0.0.0",
"type": "module",
"license": "MIT",
"author": "Wonderland",
"engines": {
Expand Down Expand Up @@ -41,9 +40,12 @@
"@next/eslint-plugin-next": "14.1.3",
"@rainbow-me/rainbowkit": "2.0.2",
"@tanstack/react-query": "5.28.0",
"i18next": "23.7.6",
"next": "14.1.3",
"next-i18next": "15.2.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "14.0.0",
"react-router-dom": "6.15.0",
"viem": "2.8.6",
"wagmi": "2.5.7"
Expand Down
100 changes: 89 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"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..."
}
},
"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"
}
}
58 changes: 58 additions & 0 deletions public/locales/es/common.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading
Loading