新增:繁体中文

This commit is contained in:
ivan 2026-02-26 15:36:17 +08:00
parent d1351345b0
commit 4ab5ffa6af
7 changed files with 187 additions and 11 deletions

View File

@ -21,7 +21,7 @@
"buy": "Buy",
"sell": "Sell",
"orderBook": "Order Book",
"buyLabel": "Buy {label}",
"buyLabel": "Trade {label}",
"sellLabel": "Sell {label}",
"merge": "Merge",
"split": "Split",

View File

@ -21,7 +21,7 @@
"buy": "買う",
"sell": "売る",
"orderBook": "オーダーブック",
"buyLabel": "{label}を買う",
"buyLabel": "{label}を取引",
"sellLabel": "{label}を売る",
"merge": "マージ",
"split": "スプリット",

View File

@ -21,7 +21,7 @@
"buy": "매수",
"sell": "매도",
"orderBook": "호가창",
"buyLabel": "{label} 매수",
"buyLabel": "{label} 거래",
"sellLabel": "{label} 매도",
"merge": "병합",
"split": "분할",

View File

@ -21,7 +21,7 @@
"buy": "买入",
"sell": "卖出",
"orderBook": "订单簿",
"buyLabel": "{label}",
"buyLabel": "交易{label}",
"sellLabel": "卖{label}",
"merge": "合并",
"split": "拆分",

172
src/locales/zh-TW.json Normal file
View File

@ -0,0 +1,172 @@
{
"common": {
"login": "登入",
"logout": "登出",
"balance": "餘額",
"back": "返回",
"search": "搜尋",
"filter": "篩選",
"collapse": "收起",
"delete": "刪除",
"clear": "清空",
"loading": "載入中...",
"more": "更多操作",
"user": "用戶",
"chance": "機率"
},
"toast": {
"orderSuccess": "下單成功"
},
"trade": {
"buy": "買入",
"sell": "賣出",
"orderBook": "訂單簿",
"buyLabel": "交易{label}",
"sellLabel": "賣{label}",
"merge": "合併",
"split": "拆分",
"market": "市價",
"limit": "限價",
"deposit": "入金",
"amount": "金額",
"shares": "份額",
"limitPrice": "限價",
"setExpiration": "設定到期",
"total": "合計",
"toWin": "可獲得",
"youllReceive": "您將收到",
"avgPrice": "平均價",
"max": "最大",
"balanceLabel": "餘額",
"pleaseLogin": "請先登入",
"pleaseSelectMarket": "請先選擇市場(需包含 clobTokenIds",
"userError": "用戶資訊異常",
"orderFailed": "下單失敗",
"expiration": {
"5m": "5分鐘",
"15m": "15分鐘",
"30m": "30分鐘",
"1h": "1小時",
"2h": "2小時",
"4h": "4小時",
"8h": "8小時",
"12h": "12小時",
"1d": "1天",
"2d": "2天",
"3d": "3天"
}
},
"home": {
"searchHistory": "搜尋歷史",
"searchPlaceholder": "Search",
"loadMore": "載入更多"
},
"error": {
"requestFailed": "請求失敗",
"loadFailed": "載入失敗",
"invalidId": "無效的 ID 或 slug"
},
"activity": {
"comments": "評論",
"topHolders": "持倉大戶",
"activity": "動態",
"noCommentsYet": "暫無評論",
"topHoldersPlaceholder": "持倉大戶將在此顯示",
"minAmount": "最小金額",
"any": "",
"live": "即時",
"bought": "買入",
"sold": "賣出",
"at": "以",
"viewTransaction": "查看交易",
"justNow": "剛剛",
"minutesAgo": "{n}分鐘前",
"hoursAgo": "{n}小時前",
"daysAgo": "{n}天前",
"weeksAgo": "{n}週前"
},
"wallet": {
"portfolio": "資產組合",
"today": "今日",
"deposit": "入金",
"withdraw": "提現",
"profitLoss": "盈虧",
"allTime": "全部",
"pl1D": "1天",
"pl1W": "1週",
"pl1M": "1月",
"plAll": "全部",
"positions": "持倉",
"openOrders": "未成交",
"history": "歷史",
"searchPlaceholder": "搜尋",
"currentValue": "當前價值",
"closeLosses": "平倉虧損",
"all": "全部",
"newest": "最新",
"export": "匯出",
"cancelAll": "全部撤單",
"noPositionsFound": "暫無持倉",
"noOpenOrdersFound": "暫無未成交訂單",
"noHistoryFound": "您還未進行過任何交易",
"market": "市場",
"avgNow": "均價→現價",
"bet": "投注",
"toWin": "可贏",
"value": "價值",
"action": "操作",
"side": "方向",
"outcome": "結果",
"price": "價格",
"filled": "成交",
"total": "合計",
"expiration": "到期",
"activity": "活動",
"view": "查看",
"expirationLabel": "到期"
},
"deposit": {
"title": "入金",
"polymarketBalance": "Polymarket 餘額:",
"transferCrypto": "轉帳加密貨幣",
"connectExchange": "連接交易所",
"noLimit": "無限制",
"instant": "即時到帳",
"twoMin": "約 2 分鐘",
"network": "網路",
"supportedTip": "支援USDC、ETH",
"depositAddress": "充值地址",
"copy": "複製",
"copied": "已複製",
"connectDesc": "連接錢包以充值。連接後,將 USDC 或 ETH 發送至您的充值地址。",
"connectedTip": "已連接。請將 USDC 或 ETH 發送至下方地址。",
"metaMask": "MetaMask",
"coinbaseComingSoon": "Coinbase Wallet即將推出",
"walletConnectComingSoon": "WalletConnect即將推出",
"close": "關閉",
"installMetaMask": "請安裝 MetaMask 或其他 Web3 錢包。"
},
"withdraw": {
"title": "提現",
"polymarketBalance": "Polymarket 餘額:",
"amountUsd": "金額 (USD)",
"max": "最大",
"network": "網路",
"withdrawTo": "提現至",
"connectedWallet": "已連接錢包",
"customAddress": "自訂地址",
"connectWallet": "連接錢包",
"walletAddress": "錢包地址",
"amountPlaceholder": "0.00",
"addressPlaceholder": "0x...",
"amountMustBePositive": "金額必須大於 0",
"insufficientBalance": "餘額不足",
"close": "關閉"
},
"locale": {
"zh": "繁體中文",
"en": "English",
"ja": "日本語",
"ko": "한국어"
}
}

View File

@ -1,10 +1,11 @@
import { createI18n } from 'vue-i18n'
import zhCN from '../locales/zh-CN.json'
import zhTW from '../locales/zh-TW.json'
import en from '../locales/en.json'
import ja from '../locales/ja.json'
import ko from '../locales/ko.json'
export type LocaleCode = 'zh-CN' | 'en' | 'ja' | 'ko'
export type LocaleCode = 'zh-CN' | 'zh-TW' | 'en' | 'ja' | 'ko'
const LOCALE_STORAGE_KEY = 'poly-locale'
@ -13,7 +14,7 @@ export const defaultLocale: LocaleCode = 'zh-CN'
function loadSavedLocale(): LocaleCode {
try {
const saved = localStorage.getItem(LOCALE_STORAGE_KEY)
if (saved && ['zh-CN', 'en', 'ja', 'ko'].includes(saved)) {
if (saved && ['zh-CN', 'zh-TW', 'en', 'ja', 'ko'].includes(saved)) {
return saved as LocaleCode
}
} catch {
@ -26,12 +27,14 @@ export const i18n = createI18n({
legacy: false,
locale: loadSavedLocale(),
fallbackLocale: 'en',
// vue-i18n 默认类型只认 en-US用 as any 绕过以支持 zh-CN/zh-TW 等
messages: {
'zh-CN': zhCN as Record<string, unknown>,
en: en as Record<string, unknown>,
ja: ja as Record<string, unknown>,
ko: ko as Record<string, unknown>,
},
'zh-CN': zhCN,
'zh-TW': zhTW,
en,
ja,
ko,
} as any,
})
export function setLocale(locale: LocaleCode) {

View File

@ -8,6 +8,7 @@ export const useLocaleStore = defineStore('locale', () => {
const localeOptions: { value: LocaleCode; label: string }[] = [
{ value: 'zh-CN', label: '简体中文' },
{ value: 'zh-TW', label: '繁體中文' },
{ value: 'en', label: 'English' },
{ value: 'ja', label: '日本語' },
{ value: 'ko', label: '한국어' },