@@ -42,7 +42,7 @@ The process is similar to updating an existing translation, and has the same req
42
42
43
43
For release builds (RELEASE=1), the firmware uses wenquanyi_9pt_u8g2.bdf to display unicode characters.
44
44
Please check if the new language character codepoint is included in wenquanyi_9pt_u8g2.bdf or not.
45
- If not, it's not recommended to support the new language due to the MCU internal flash restrictions.
45
+ If not, it's not recommended supporting the new language due to the MCU internal flash restrictions.
46
46
47
47
## Web App
48
48
@@ -52,41 +52,41 @@ The language file can be found under `web/src/i18n'
52
52
53
53
## How to add new language translation
54
54
55
- In this example, we will add a Japanese (jp_JP ) translation:
55
+ In this example, we will add a Japanese (ja_JP ) translation:
56
56
57
- 1 . Copy the ` en_US.js ` file and name it ` jp_JP .js`
58
- 2 . Translate the string within ` jp_JP .js` including the ` changeok ` message.
57
+ 1 . Copy the ` en_US.js ` file and name it ` ja_JP .js`
58
+ 2 . Translate the string within ` ja_JP .js` including the ` changeok ` message.
59
59
60
60
Don't translate the other language names.
61
61
62
62
Add your language at the bottom of the ` lang { ` section:
63
63
64
- ` jp : '日本語',`
64
+ ` ja : '日本語',`
65
65
66
- 3 . Edit ` index.js ` while keeping it's current structure, adding:
66
+ 3 . Edit ` index.js ` while keeping its current structure, adding:
67
67
68
68
``` js
69
- import elementJpLocale from ' element-ui/lib/locale/lang/jp ' // element-ui
70
- lang import jpLocale from ' ./jp_JP ' elementJpLocale
69
+ import elementJaLocale from ' element-ui/lib/locale/lang/ja ' // element-ui
70
+ lang import jaLocale from ' ./ja_JP ' elementJpLocale
71
71
```
72
72
73
73
And extending ` messages ` :
74
74
75
75
``` js
76
- jp_JP : {
77
- ... jpLocale ,
78
- ... elementJpLocale ,
76
+ ja_JP : {
77
+ ... jaLocale ,
78
+ ... elementJaLocale ,
79
79
},
80
80
```
81
81
82
82
4. Add your language to the other ` .js` files (within the ` lang: {` section):
83
83
84
- ` vuejp : '日本語',`
84
+ ` vueja : '日本語',`
85
85
86
86
5. Add your language to the ` web/src/App.vue` file:
87
87
88
88
` ` ` js
89
- <el-dropdown-item Enabled="language==='jp '" command="jp " divided>
90
- {{ $t('lang.jp ') }}
89
+ <el-dropdown-item Enabled="language==='ja '" command="ja " divided>
90
+ {{ $t('lang.ja ') }}
91
91
</el-dropdown-item>
92
92
` ` `
0 commit comments