Skip to content

Commit

Permalink
Merge branch 'staging' into add-amendments-list
Browse files Browse the repository at this point in the history
  • Loading branch information
pdp2121 authored Nov 15, 2023
2 parents facec3e + 032f709 commit 9fae800
Show file tree
Hide file tree
Showing 28 changed files with 5,186 additions and 3,412 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ VITE_MAINNET_LINK=
VITE_TESTNET_LINK=
VITE_DEVNET_LINK=
VITE_AMM_LINK=
VITE_HOOKS_TESTNET_LINK=
VITE_XAHAU_MAINNET_LINK=
VITE_XAHAU_TESTNET_LINK=
VITE_CUSTOMNETWORK_LINK=
VITE_VALIDATOR=vl.ripple.com

Expand Down
10 changes: 4 additions & 6 deletions docs/how-to-define-a-language.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# How Languages Are Defined

1. Add the new language code to the array `supportedLanguages` in [/src/i18n/baseConfig.ts](../src/i18n/baseConfig.ts)
2. Add an entry to default language file [/public/locales/en-US/translations.json](../public/locales/en-US/translations.json) with the key being `language_{languageCode}`.
Example: `language_en-US`
3. Create a folder in [/public/locales/](../public/locales) with the language code as its name.
4. Add a new file, `translations.json`, to the new folder.
5. Translate all the entries. If you prefer to use the English version just set the value to `null`.
1. Add the new language code and language name to the map `supportedLanguages` in [/src/i18n/baseConfig.ts](../src/i18n/baseConfig.ts)
2. Create a folder in [/public/locales/](../public/locales) with the language code as its name.
3. Add a new file, `translations.json`, to the new folder.
4. Translate all the entries. If you prefer to use the English version just set the value to `null`.

Example file: [/public/locales/ja-JP/translations.json](../public/locales/ja-JP/translations.json)
8,275 changes: 4,973 additions & 3,302 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"version": "1.5.0",
"dependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@google-cloud/bigquery": "^5.5.0",
"@google-cloud/bigquery": "^7.3.0",
"@paystring/utils": "^2.0.0",
"@redux-devtools/extension": "^3.2.5",
"@rollup/plugin-inject": "^5.0.3",
"@vitejs/plugin-react": "^3.0.0",
"@xrplf/prettier-config": "^1.9.1",
Expand Down Expand Up @@ -39,12 +40,11 @@
"react-i18next": "^12.3.1",
"react-json-view": "^1.21.3",
"react-query": "^3.39.3",
"react-redux": "^7.0.1",
"react-redux": "^8.1.3",
"react-router": "^6.12.1",
"react-router-dom": "^6.15.0",
"recharts": "^2.7.2",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.8",
"redux": "^4.2.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"rewire": "^6.0.0",
Expand All @@ -57,20 +57,20 @@
"vite": "^4.2.3",
"vite-plugin-environment": "^1.1.3",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^2.4.0",
"vite-plugin-svgr": "^4.1.0",
"vite-tsconfig-paths": "^4.2.0",
"ws": "^7.4.2",
"xrpl-client": "^2.1.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.6",
"@babel/preset-env": "^7.21.4",
"@babel/preset-env": "^7.23.2",
"@babel/preset-react": "^7.22.15",
"@types/create-hash": "^1.2.2",
"@types/enzyme": "^3.10.12",
"@types/jest": "^26.0.24",
"@types/lodash": "^4.14.194",
"@types/node": "^17.0.8",
"@types/node": "^18.18.8",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.9",
"@types/react-redux": "^7.1.22",
Expand All @@ -87,27 +87,27 @@
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest-enzyme": "^7.1.0",
"jest-websocket-mock": "^2.5.0",
"lint-staged": "^13.2.0",
"lint-staged": "^15.0.2",
"mock-socket": "^9.1.5",
"moxios": "^0.4.0",
"nodemon": "^3.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"prettier": "^3.0.3",
"react-error-overlay": "6.0.11",
"react-test-renderer": "^17.0.2",
"redux-mock-store": "^1.5.1",
"sass": "^1.51.0",
"source-map-explorer": "^2.5.3",
"stylelint": "^15.6.2",
"stylelint": "^15.11.0",
"stylelint-config-idiomatic-order": "^9.0.0",
"stylelint-config-recommended-scss": "^12.0.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-prettier": "^3.0.0",
"stylelint-config-recommended-scss": "^13.1.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.0.0",
"stylelint-scss": "^5.1.0",
"ts-jest": "^26.5.6",
"ts-node": "^10.9.1",
Expand Down
12 changes: 5 additions & 7 deletions public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"network_name_mainnet": "Mainnet",
"network_name_devnet": "Devnet",
"network_name_amm": "AMM-Devnet",
"network_name_hooks_testnet": "Hooks-Testnet",
"network_name_xahau_mainnet": "Xahau Mainnet",
"network_name_xahau_testnet": "Xahau Testnet",
"network_name_custom": "Custom",
"app.meta.description": "XRPL Network Explorer",
"app.meta.author": "Ripple",
Expand Down Expand Up @@ -468,11 +469,6 @@
"check_crawl_existed": "Please contact the operator to make sure they have /crawl accessible or a vl set.",
"peer_crawled_context": "For more context, see https://xrpl.org/peer-crawler.html",
"xchainbridge": "XChainBridge",
"language_en-US": "English",
"language_fr-FR": "French",
"language_ja-JP": "Japanese",
"language_ko-KR": "Korean",
"language_es-ES": "Spanish",
"xchain_account_claim_count": "XChain Account Claim Count",
"xchain_account_create_count": "XChain Account Create Count",
"min_signer_quorum": "Minimum weight <0>{{quorum}}</0> required",
Expand Down Expand Up @@ -501,5 +497,7 @@
"api_version": "API Version",
"triggered_on": "Triggered On",
"did_document": "DID Document",
"attestation": "Attestation"
"attestation": "Attestation",
"transaction_tokens_involved": "<Currency/> and <Currency2/>",
"transaction_tokens_swapped": "<Currency/> for <Currency2/>"
}
12 changes: 5 additions & 7 deletions public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"network_name_mainnet": "Mainnet",
"network_name_devnet": "Devnet",
"network_name_amm": "AMM-Devnet",
"network_name_hooks_testnet": "Hooks-Testnet",
"network_name_xahau_mainnet": "Xahau Mainnet",
"network_name_xahau_testnet": "Xahau Testnet",
"network_name_custom": "Personalizada",
"app.meta.description": "Explorador de la Red XRPL",
"app.meta.author": "Ripple",
Expand Down Expand Up @@ -464,11 +465,6 @@
"check_crawl_existed": "Por favor, contacta con el operador para asegurarte de que tienen acceso a /crawl o un vl incluido.",
"peer_crawled_context": "Para más contexto, mira https://xrpl.org/peer-crawler.html",
"xchainbridge": "XChainBridge",
"language_en-US": "Inglés",
"language_ja-JP": "Japonés",
"language_kr-KR": "Coreano",
"language_fr-FR": "Francés",
"language_es-ES": "Español",
"xchain_account_claim_count": "Contador de Reclamación de Cuentas XChain",
"xchain_account_create_count": "Contador de Creación de Cuentas XChain",
"min_signer_quorum": "Peso mínimo <0>{{quorum}}</0> requerido",
Expand All @@ -495,5 +491,7 @@
"grant": "Subvención",
"namespace": "Espacio de Nombres",
"api_version": "Versión API",
"triggered_on": "Activado En"
"triggered_on": "Activado En",
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
}
10 changes: 5 additions & 5 deletions public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"network_name_mainnet": "Mainnet",
"network_name_devnet": "Devnet",
"network_name_amm": "AMM-Devnet",
"network_name_hooks_testnet": "Hooks-Testnet",
"network_name_xahau_mainnet": "Xahau Mainnet",
"network_name_xahau_testnet": "Xahau Testnet",
"network_name_custom": "Personnalisé",
"app.meta.description": "Explorateur XRPL",
"app.meta.author": "Ripple",
Expand Down Expand Up @@ -466,9 +467,6 @@
"check_crawl_existed": "Veuillez contacter l'opérateur pour vous assurer qu'il dispose d'un accès /crawl accessible ou d'un ensemble vl.",
"peer_crawled_context": "Pour plus de contexte, voir https://xrpl.org/peer-crawler.html",
"xchainbridge": "Pont XChain",
"language_en-US": "Anglais",
"language_ja-JP": "Japonais",
"language_fr-FR": "Français",
"xchain_account_claim_count": "Nombre de réclamations de compte XChain",
"xchain_account_create_count": "Nombre de compte XChain créés",
"min_signer_quorum": "Poids minimum <0>{{quorum}}</0> requis.",
Expand Down Expand Up @@ -496,5 +494,7 @@
"grant": "Allocation",
"namespace": "Espace de noms",
"api_version": "Version API",
"triggered_on": "Déclenché Par"
"triggered_on": "Déclenché Par",
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
}
12 changes: 5 additions & 7 deletions public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"network_name_mainnet": "Mainnet",
"network_name_devnet": "Devnet",
"network_name_amm": "AMM-Devnet",
"network_name_hooks_testnet": "Hooks-Testnet",
"network_name_xahau_mainnet": "Xahau Mainnet",
"network_name_xahau_testnet": "Xahau Testnet",
"network_name_custom": "Custom",
"app.meta.description": "XRPLネットワークエクスプローラ",
"app.meta.author": "Ripple",
Expand Down Expand Up @@ -466,11 +467,6 @@
"check_crawl_existed": null,
"peer_crawled_context": null,
"xchainbridge": null,
"language_en-US": null,
"language_fr-FR": null,
"language_ja-JP": null,
"language_ko-KR": null,
"language_es-ES": null,
"xchain_account_claim_count": null,
"xchain_account_create_count": null,
"min_signer_quorum": null,
Expand All @@ -497,5 +493,7 @@
"grant": null,
"namespace": "ネームスペース",
"api_version": "APIバージョン",
"triggered_on": null
"triggered_on": null,
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
}
14 changes: 6 additions & 8 deletions public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"network_name_mainnet": "Mainnet",
"network_name_devnet": "Devnet",
"network_name_amm": "AMM-Devnet",
"network_name_hooks_testnet": "Hooks-Testnet",
"network_name_xahau_mainnet": "Xahau Mainnet",
"network_name_xahau_testnet": "Xahau Testnet",
"network_name_custom": "Custom",
"app.meta.description": "XRPL 네트워크 탐색기",
"app.meta.author": "리플",
Expand Down Expand Up @@ -464,11 +465,6 @@
"check_crawl_existed": "운영자에게 연락하여 /crawl이 접근 가능하거나 vl 세트가 있는지 확인하세요",
"peer_crawled_context": "더 자세한 정보는 https://xrpl.org/peer-crawler.html 를 참조하세요",
"xchainbridge": "XChain 브리지",
"language_en-US": "영어",
"language_fr-FR": "프랑스말",
"language_ja-JP": "일본어",
"language_ko-KR": "한국어",
"language_es-ES": "null",
"xchain_account_claim_count": "XChain 계정 요구 수",
"xchain_account_create_count": "XChain 계정 생성 수",
"min_signer_quorum": "최소 가중치 <0>{{quorum}}</0>가 필요합니다",
Expand All @@ -495,5 +491,7 @@
"grant": "그랜트",
"namespace": "Namespace",
"api_version": "API 버전",
"triggered_on": "Triggered On"
}
"triggered_on": "Triggered On",
"transaction_tokens_involved": null,
"transaction_tokens_swapped": null
}
15 changes: 6 additions & 9 deletions src/containers/Header/LanguagePicker/LanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import './LanguagePicker.scss'
import { supportedLanguages } from '../../../i18n/baseConfig'

export const LanguagePicker = () => {
const { t, i18n } = useTranslation()
const { i18n } = useTranslation()
const currentLanguage = useLanguage()

const handleLanguageClick = (language: string) => () => {
Expand All @@ -15,21 +15,18 @@ export const LanguagePicker = () => {
return (
<div className="language-picker">
<Dropdown
title={t(`language`, { context: currentLanguage, defaultValue: '' })}
title={supportedLanguages[currentLanguage]}
className="dropdown-right"
>
{supportedLanguages
.filter((language) => language !== currentLanguage)
.map((language) => (
{Object.entries(supportedLanguages)
.filter(([language]) => language !== currentLanguage)
.map(([language, languageName]) => (
<DropdownItem
key={language}
className={`language-picker-${language}`}
handler={handleLanguageClick(language)}
>
{t(`language`, {
context: language,
defaultValue: '',
})}
{languageName}
</DropdownItem>
))}
</Dropdown>
Expand Down
9 changes: 7 additions & 2 deletions src/containers/Header/NetworkPicker/NetworkPicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@
}

/* stylelint-disable-next-line selector-class-pattern -- needed here for variables */
&.network-hooks_testnet {
@include dropdown-network-item($hooks-testnet, $magenta-40);
&.network-xahau_mainnet {
@include dropdown-network-item($xahau-mainnet, $green-50);
}

/* stylelint-disable-next-line selector-class-pattern -- needed here for variables */
&.network-xahau_testnet {
@include dropdown-network-item($xahau-testnet, $magenta-40);
}

&.network-custom {
Expand Down
3 changes: 2 additions & 1 deletion src/containers/Header/NetworkPicker/NetworkPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const STATIC_ENV_LINKS: Record<string, string | undefined> = {
testnet: process.env.VITE_TESTNET_LINK,
devnet: process.env.VITE_DEVNET_LINK,
amm: process.env.VITE_AMM_LINK,
hooks_testnet: process.env.VITE_HOOKS_TESTNET_LINK,
xahau_mainnet: process.env.VITE_XAHAU_MAINNET_LINK,
xahau_testnet: process.env.VITE_XAHAU_TESTNET_LINK,
}
const currentMode: string = process.env.VITE_ENVIRONMENT || 'mainnet'

Expand Down
11 changes: 7 additions & 4 deletions src/containers/Ledgers/Ledgers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getAction, getCategory } from '../shared/components/Transaction'
import { TransactionActionIcon } from '../shared/components/TransactionActionIcon/TransactionActionIcon'
import { Legend } from './Legend'
import { RouteLink } from '../shared/routing'
import { LEDGER_ROUTE, TRANSACTION_ROUTE } from '../App/routes'
import { LEDGER_ROUTE, TRANSACTION_ROUTE, VALIDATOR_ROUTE } from '../App/routes'

class Ledgers extends Component {
constructor(props) {
Expand Down Expand Up @@ -71,13 +71,16 @@ class Ledgers extends Component {
renderSelected = () => {
const { validators, selected } = this.state
const v = validators[selected] || {}
const url = `/validators/${selected}`
return (
<div className="selected-validator">
{v.domain && <DomainLink domain={v.domain} />}
<a className="pubkey" href={url}>
<RouteLink
to={VALIDATOR_ROUTE}
params={{ identifier: selected }}
className="pubkey"
>
{selected}
</a>
</RouteLink>
</div>
)
}
Expand Down
Loading

0 comments on commit 9fae800

Please sign in to comment.