Localization (i18n)
The modal UI defaults to English (en-US). You can override individual strings, supply a full custom locale, or build a message bundle for any language.
XRPL key markets
XRPL has strong institutional and retail communities in Japan (SBI Ripple Asia), South Korea, Southeast Asia, and China. The examples below use Japanese and Korean as real-world references.
Switching Language
Pass a language locale code to activate a built-in locale:
import { WalletModal } from "@xrpl-wallet-kit/ui";
// English — default, no need to specify
const modal = new WalletModal({ manager });
// Switch to Japanese (requires providing a messages object — see below)
const modal = new WalletModal({
manager,
language: "ja-JP",
messages: jaJPMessages,
});Built-in Locales
Only English ships as a fully pre-translated bundle out of the box.
| Locale code | Language | Bundled message object |
|---|---|---|
"en-US" (default) | English | enUSMessages |
Shorthand aliases are accepted: "en" → en-US, "ja" → ja-JP, "ko" → ko-KR, "zh" → zh-CN, "zh-TW" → zh-TW.
Unrecognised locales fall back to en-US.
Custom Strings
Override individual strings while keeping the rest as English defaults:
import { WalletModal, enUSMessages } from "@xrpl-wallet-kit/ui";
const modal = new WalletModal({
manager,
messages: {
...enUSMessages,
connectWallet: "Link your XRPL wallet",
approveRequest: "Please approve in your wallet app…",
connected: "Wallet linked",
},
});All Available Keys
interface WalletUiMessages {
// Static strings
connectWallet: string; // Modal title / header
connect: string; // Connect button label
connected: string; // Connected state label
connectedAccount: string; // Connected account section label
close: string; // Close button aria label
back: string; // Back button aria label
approveRequest: string; // Waiting for wallet approval
walletFallbackName: string; // Generic fallback wallet name
connecting: string; // Connecting state label
retrying: string; // Retry in-progress label
tryAgain: string; // Retry button label
connectionCanceledTitle: string; // Cancelled error title
requestRejected: string; // Rejection error message
connectionTimedOutTitle: string; // Timeout error title
requestTimedOut: string; // Timeout error message
connectionFailedTitle: string; // Generic failure title
helpScan: string; // QR scan hint
helpTryAgainNewRequest: string; // Help text after failure
pleaseTryAgain: string; // Generic retry prompt
waitingForWalletConnectUri: string;// WalletConnect loading state
qrSrHint: string; // Screen reader hint for QR
generatingQr: string; // QR generating state
copied: string; // Copy success feedback
copyUri: string; // Copy URI button
openWallet: string; // Open wallet app button
qrUriCopied: string; // Toast after URI copy
installed: string; // Installed badge label
copyAddress: string; // Copy address button
addressQr: string; // Address QR label
showAddressQr: string; // Show address QR aria label
copying: string; // Copying in-progress
viewExplorer: string; // View on explorer link
disconnect: string; // Disconnect button
disconnecting: string; // Disconnect in-progress
notActivated: string; // Account not activated label
// Dynamic strings (functions)
connectWalletAria: (walletName: string) => string;
confirmOnDevice: (walletName: string) => string;
openWalletAppApprove: (walletName: string) => string;
approveBrowserWallet: () => string;
clickConnectPopup: (walletName: string) => string;
walletCount: (count: number) => string;
moreWallets: (count: number) => string;
accountNotActivated: (asset: string) => string;
}Adding a New Language
Create a message object and pass it to WalletModal. Keys not provided fall back to the English default automatically.
Japanese (ja-JP)
// src/locales/ja-JP.ts
import type { WalletUiMessages } from "@xrpl-wallet-kit/ui";
export const jaJPMessages: Partial<WalletUiMessages> = {
connectWallet: "ウォレットを接続",
connect: "接続",
connected: "接続済み",
connecting: "接続中…",
disconnect: "切断",
disconnecting: "切断中…",
back: "戻る",
close: "閉じる",
approveRequest: "ウォレットアプリで承認してください",
tryAgain: "再試行",
retrying: "再試行中…",
helpScan: "ウォレットアプリでQRコードをスキャン",
copyUri: "URIをコピー",
openWallet: "アプリを開く",
copied: "コピー済み",
copyAddress: "アドレスをコピー",
viewExplorer: "エクスプローラーで見る",
waitingForWalletConnectUri: "接続URIを待機中…",
qrSrHint: "QRコードをスキャンしてウォレットを接続",
installed: "インストール済み",
notActivated: "未アクティブ",
requestRejected: "リクエストが拒否されました",
connectionFailedTitle: "接続に失敗しました",
connectionTimedOutTitle: "接続がタイムアウトしました",
connectionCanceledTitle: "接続がキャンセルされました",
connectWalletAria: (w) => `${w}を接続`,
confirmOnDevice: (w) => `${w}デバイスで確認してください`,
openWalletAppApprove: (w) => `${w}アプリを開いて承認`,
approveBrowserWallet: () => "ブラウザウォレットで承認",
clickConnectPopup: (w) => `${w}のポップアップで接続`,
walletCount: (n) => `${n}件のウォレット`,
moreWallets: (n) => `+${n}件`,
accountNotActivated: (a) => `アカウント未アクティブ。${a}を送金して有効化してください`,
};import { WalletModal } from "@xrpl-wallet-kit/ui";
import { jaJPMessages } from "./locales/ja-JP";
const modal = new WalletModal({
manager,
language: "ja-JP",
messages: jaJPMessages,
});Korean (ko-KR)
// src/locales/ko-KR.ts
import type { WalletUiMessages } from "@xrpl-wallet-kit/ui";
export const koKRMessages: Partial<WalletUiMessages> = {
connectWallet: "지갑 연결",
connect: "연결",
connected: "연결됨",
connecting: "연결 중…",
disconnect: "연결 해제",
back: "뒤로",
close: "닫기",
approveRequest: "지갑 앱에서 승인해 주세요",
tryAgain: "다시 시도",
helpScan: "지갑 앱으로 QR 코드를 스캔하세요",
copyUri: "URI 복사",
openWallet: "앱 열기",
copied: "복사됨",
copyAddress: "주소 복사",
viewExplorer: "탐색기에서 보기",
waitingForWalletConnectUri: "연결 URI 대기 중…",
installed: "설치됨",
requestRejected: "요청이 거부되었습니다",
connectionFailedTitle: "연결 실패",
connectWalletAria: (w) => `${w} 연결`,
confirmOnDevice: (w) => `${w} 기기에서 확인하세요`,
openWalletAppApprove: (w) => `${w} 앱을 열고 승인하세요`,
approveBrowserWallet: () => "브라우저 지갑에서 승인",
clickConnectPopup: (w) => `${w} 팝업에서 연결`,
walletCount: (n) => `지갑 ${n}개`,
moreWallets: (n) => `+${n}개`,
accountNotActivated: (a) => `계정이 활성화되지 않았습니다. ${a}을 전송하여 활성화하세요`,
};Chinese Simplified (zh-CN)
// src/locales/zh-CN.ts
import type { WalletUiMessages } from "@xrpl-wallet-kit/ui";
export const zhCNMessages: Partial<WalletUiMessages> = {
connectWallet: "连接钱包",
connect: "连接",
connected: "已连接",
connecting: "连接中…",
disconnect: "断开连接",
back: "返回",
close: "关闭",
approveRequest: "请在钱包应用中确认",
tryAgain: "重试",
helpScan: "用钱包应用扫描二维码",
copyUri: "复制 URI",
openWallet: "打开应用",
copied: "已复制",
copyAddress: "复制地址",
viewExplorer: "在浏览器中查看",
waitingForWalletConnectUri: "等待连接 URI…",
installed: "已安装",
requestRejected: "请求被拒绝",
connectionFailedTitle: "连接失败",
connectWalletAria: (w) => `连接 ${w}`,
confirmOnDevice: (w) => `请在 ${w} 设备上确认`,
openWalletAppApprove: (w) => `打开 ${w} 应用并批准`,
approveBrowserWallet: () => "在浏览器钱包中批准",
clickConnectPopup: (w) => `在 ${w} 弹窗中连接`,
walletCount: (n) => `${n} 个钱包`,
moreWallets: (n) => `+${n} 个`,
accountNotActivated: (a) => `账户未激活,请发送 ${a} 以激活`,
};Runtime Language Switching
// Update after initialization — re-renders with new strings immediately
modal.updateOptions({
language: "ja-JP",
messages: jaJPMessages,
});See also
- Theming — visual customization
- WalletModal & WalletButton API — full options reference