Skip to content

Commit

Permalink
feat: traditional chinese locales (zh-TW and zh-HK) (#2153)
Browse files Browse the repository at this point in the history
* feat: add zh-TW, zh-HK lang support

* chore: changeset
  • Loading branch information
DanielSinclair authored Aug 22, 2024
1 parent 9c36bfd commit c08f620
Show file tree
Hide file tree
Showing 84 changed files with 10,611 additions and 443 deletions.
6 changes: 6 additions & 0 deletions .changeset/fluffy-items-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"example": patch
"site": patch
---

Added `zh-HK` and `zh-TW` locales for Traditional Chinese language support
7 changes: 7 additions & 0 deletions .changeset/happy-cherries-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rainbow-me/rainbowkit": patch
---

Added `zh-HK` and `zh-TW` locales for Traditional Chinese language support. You can also specify `zh-Hans` and `zh-Hant` locales to refer to the writing systems directly.

Reference [our guide](https://www.rainbowkit.com/docs/localization) to learn more about Localization.
2 changes: 2 additions & 0 deletions packages/example/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports = {
'tr-TR',
'uk-UA',
'zh-CN',
'zh-HK',
'zh-TW',
],
},
reactStrictMode: true,
Expand Down
12 changes: 11 additions & 1 deletion packages/rainbowkit/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export type Locale =
| 'ua'
| 'uk-UA'
| 'zh'
| 'zh-CN';
| 'zh-CN'
| 'zh-HK'
| 'zh-TW'
| 'zh-Hans'
| 'zh-Hant';

export const i18n = new I18n({
en: JSON.parse(en_US as any),
Expand Down Expand Up @@ -83,7 +87,13 @@ const fetchTranslations = async (locale: Locale): Promise<any> => {
return (await import('./uk_UA.json')).default;
case 'zh':
case 'zh-CN':
case 'zh-Hans':
return (await import('./zh_CN.json')).default;
case 'zh-HK':
return (await import('./zh_HK.json')).default;
case 'zh-Hant':
case 'zh-TW':
return (await import('./zh_TW.json')).default;
default:
return (await import('./en_US.json')).default;
}
Expand Down
46 changes: 46 additions & 0 deletions packages/rainbowkit/src/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,22 @@
}
}
},
"iopay": {
"qr_code": {
"step1": {
"description": "我们建议您将ioPay添加到主屏幕,以便更快地访问您的钱包。",
"title": "打开ioPay应用"
},
"step2": {
"description": "您可以使用我们的手机上的备份功能轻松备份您的钱包。",
"title": "创建或导入钱包"
},
"step3": {
"description": "在您扫描后,将出现连接提示,供您连接您的钱包。",
"title": "点击WalletConnect按钮"
}
}
},
"kaikas": {
"extension": {
"step1": {
Expand Down Expand Up @@ -582,6 +598,36 @@
}
}
},
"kaia": {
"extension": {
"step1": {
"description": "我们建议将Kaia固定在您的任务栏上,以便更快地访问您的钱包。",
"title": "安装Kaia扩展程序"
},
"step2": {
"description": "务必使用安全的方法备份您的钱包。决不与任何人分享您的秘密短语。",
"title": "创建或导入钱包"
},
"step3": {
"description": "设置钱包后,点击下方刷新浏览器并加载扩展。",
"title": "刷新您的浏览器"
}
},
"qr_code": {
"step1": {
"title": "打开Kaia应用",
"description": "将Kaia应用放在您的主屏幕上,以更快地访问您的钱包。"
},
"step2": {
"title": "创建或导入钱包",
"description": "创建新钱包或导入现有钱包。"
},
"step3": {
"title": "点击右上角的扫描图标",
"description": "选择新连接,然后扫描二维码并确认提示以进行连接。"
}
}
},
"kraken": {
"qr_code": {
"step1": {
Expand Down
Loading

0 comments on commit c08f620

Please sign in to comment.