diff options
| author | Baoyuan <baoyuan.top@gmail.com> | 2021-07-16 23:02:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-16 08:02:03 -0700 |
| commit | bc51f1b761763ca585f225190e7d859e0cd03209 (patch) | |
| tree | ff95dfbc8db6a9adda815dc8f39ec7588130bfbe /src/i18n.js | |
| parent | a283fe4628aad3750be0cd300983b9a3100fdf05 (diff) | |
[Issue #49] feat: add i18n (#58)
* feat: add i18n
* fix: code clean
Diffstat (limited to 'src/i18n.js')
| -rw-r--r-- | src/i18n.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/i18n.js b/src/i18n.js new file mode 100644 index 0000000..2990dcb --- /dev/null +++ b/src/i18n.js | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | import i18n from 'i18next'; | ||
| 2 | import { initReactI18next } from 'react-i18next'; | ||
| 3 | |||
| 4 | const resources = { | ||
| 5 | 'en-US': { | ||
| 6 | translation: { | ||
| 7 | title: 'WiFi Card', | ||
| 8 | 'desc.use': | ||
| 9 | 'Print a simple card with your WiFi login details. Tape it to the fridge, keep it in your wallet, etc.', | ||
| 10 | 'desc.privacy': | ||
| 11 | 'Your WiFi information is never sent to the server. No tracking, analytics, or fingerprinting are used on this website. View the', | ||
| 12 | 'desc.source': 'source code', | ||
| 13 | 'wifi.login': 'WiFi Login', | ||
| 14 | 'wifi.name': 'Network name', | ||
| 15 | 'wifi.name.placeholder': 'WiFi Network name', | ||
| 16 | 'wifi.password': 'Password', | ||
| 17 | 'wifi.password.placeholder': 'Password', | ||
| 18 | 'wifi.password.hide': 'Hide password field before printing', | ||
| 19 | 'wifi.password.encryption': 'Encryption', | ||
| 20 | 'wifi.tip': | ||
| 21 | "Point your phone's camera at the QR Code to connect automatically", | ||
| 22 | 'wifi.alert.name': 'Network name cannot be empty', | ||
| 23 | 'wifi.alert.password.length.5': 'Password must be at least 5 characters', | ||
| 24 | 'wifi.alert.password.8': 'Password must be at least 8 characters', | ||
| 25 | 'button.rotate': 'Rotate', | ||
| 26 | 'button.print': 'Print', | ||
| 27 | select: 'Select Language', | ||
| 28 | }, | ||
| 29 | }, | ||
| 30 | 简体中文: { | ||
| 31 | translation: { | ||
| 32 | title: 'WiFi 连接卡', | ||
| 33 | 'desc.use': | ||
| 34 | '打印一张带有 WiFi 详细信息的登录卡片,把它贴到冰箱上、放到你的钱包里...', | ||
| 35 | 'desc.privacy': | ||
| 36 | '您的 WiFi 信息永远不会发送到服务端。本网站不使用追踪、分析或指纹识别。查看', | ||
| 37 | 'desc.source': '源码', | ||
| 38 | 'wifi.login': '连接 WiFi', | ||
| 39 | 'wifi.name': '网络名称', | ||
| 40 | 'wifi.name.placeholder': 'WiFi 网络名称', | ||
| 41 | 'wifi.password': '密码', | ||
| 42 | 'wifi.password.placeholder': '密码', | ||
| 43 | 'wifi.password.hide': '打印前隐藏密码字段', | ||
| 44 | 'wifi.password.encryption': '加密', | ||
| 45 | 'wifi.tip': '将手机摄像头对准二维码即可自动连接', | ||
| 46 | 'wifi.alert.name': '网络名称不能为空', | ||
| 47 | 'wifi.alert.password.length.5': '密码至少 5 个字符', | ||
| 48 | 'wifi.alert.password.8': '密码至少 8 个字符', | ||
| 49 | 'button.rotate': '翻转', | ||
| 50 | 'button.print': '打印', | ||
| 51 | select: '选择语言', | ||
| 52 | }, | ||
| 53 | }, | ||
| 54 | }; | ||
| 55 | |||
| 56 | i18n.use(initReactI18next).init({ | ||
| 57 | resources, | ||
| 58 | lng: 'en-US', | ||
| 59 | interpolation: { | ||
| 60 | escapeValue: false, | ||
| 61 | }, | ||
| 62 | }); | ||
| 63 | |||
| 64 | export default i18n; | ||
