Skip to content

Commit b54ec2c

Browse files
committed
Markdown linting, Style changes, Typos
1 parent e15a7c1 commit b54ec2c

File tree

1 file changed

+39
-41
lines changed

1 file changed

+39
-41
lines changed

docs/en/05+5-translation.md

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,48 @@
1-
# Transalation
1+
# Translation
22

33
## Firmware
44

55
## How to update existing translation
66

77
When editing CSV files with VSCode, the extension [Edit CSV](https://marketplace.visualstudio.com/items?itemName=janisdd.vscode-edit-csv) is recommended.
88

9-
*Windows* requires you to have [Python](https://www.python.org/downloads/) and [Git](https://git-scm.com/download/windows) installed and within your `$PATH`
10-
11-
For *Linux*, most Distribution come with `python` and `git` by default and
12-
13-
*macOS* comes bundled with `python`, but to use `git` you either need to install the Command Line tools via `xcode-select –-install`, or download [Git](https://git-scm.com/download/mac) separately.
14-
15-
9+
**Windows** requires you to have [Python](https://www.python.org/downloads/) and [Git](https://git-scm.com/download/windows) installed and within your `$PATH`
10+
For **Linux**, most distributions come with `python` and `git` by default and **macOS** comes bundled with `python`, but to use `git` you either need to install the Command Line tools via `xcode-select –-install`, or download [Git](https://git-scm.com/download/mac) separately.
1611

1712
### Windows
1813

19-
2014
1. Clone this repository
21-
`git clone https://github.com/solosky/pixl.js.git; cd pixl.js`
15+
`git clone https://github.com/solosky/pixl.js.git; cd pixl.js`
2216
2. Edit `fw/data/i18n.csv`
2317
3. Run `py.exe fw/scripts/i18n_gen.py` to generate new language files.
24-
4. *Optional:* Run `py.exe fw/scripts/font_data_gen.py` to generate new font data if you add new charaters in `i18n.csv`
18+
4. _Optional:_ Run `py.exe fw/scripts/font_data_gen.py` to generate new font data if you add new characters in `i18n.csv`
2519
5. [Build the Firmware](03-Build-Firmware.md)
2620

27-
2821
### Linux and macOS
2922

3023
1. Clone this repository
31-
`git clone https://github.com/solosky/pixl.js.git; cd pixl.js`
24+
`git clone https://github.com/solosky/pixl.js.git; cd pixl.js`
3225
2. Edit `fw/data/i18n.csv`
3326
3. Run `python3 fw/scripts/i18n_gen.py` to generate new language files.
34-
4. Optional: Run `python fw/scripts/font_data_gen.py` to generate new font data if you add new charaters in `i18n.csv`
27+
4. Optional: Run `python fw/scripts/font_data_gen.py` to generate new font data if you add new characters in `i18n.csv`
3528
5. [Build the Firmware](03-Build-Firmware.md)
3629

37-
3830
## How to add new language translation
31+
3932
The process is similar to updating an existing translation, and has the same requirements depending on your Operating System.
4033

4134
1. Add new column in `fw/data/i18n.csv`, for example "ja_JP"
4235
2. Run `fw/scripts/i18n_gen.py` to generate new language files.
43-
4. Optional: Run `fw/scripts/font_data_gen.py` to generate new font data if you add new charaters in `i18n.csv`
36+
3. Optional: Run `fw/scripts/font_data_gen.py` to generate new font data if you add new characters in `i18n.csv`
4437
4. Edit `fw/application/src/i18n/language.h` and `fw/application/src/i18n/language.c` to adopt new language
4538
5. Edit Makefile to include `$(PROJ_DIR)/i18n/ja_JP.c` as C source files
46-
5. [Build the Firmware](03-Build-Firmware.md)
39+
6. [Build the Firmware](03-Build-Firmware.md)
4740

48-
## Font notes
49-
50-
For release builds (RELEASE=1), the firmware uses wenquanyi_9pt_u8g2.bdf to display unicode characters. <br />
51-
Please check if the new language charater codepoint is included in wenquanyi_9pt_u8g2.bdf or not.<br />
52-
If not, it's not recommended to support the new language due to the MCU internal flash restrction.
41+
## Font notes
5342

43+
For release builds (RELEASE=1), the firmware uses wenquanyi_9pt_u8g2.bdf to display unicode characters.
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.
5446

5547
## Web App
5648

@@ -65,30 +57,36 @@ In this example, we will add a Japanese (jp_JP) translation:
6557
1. Copy the `en_US.js` file and name it `jp_JP.js`
6658
2. Translate the string within `jp_JP.js` including the `changeok` message.
6759

68-
Don't translate the other language names.
60+
Don't translate the other language names.
6961

70-
Add your language at the bottom of the `lang {` section:
71-
`jp: '日本語',`
62+
Add your language at the bottom of the `lang {` section:
7263

73-
3. Edit `index.js` while keeping it's current structure:
64+
`jp: '日本語',`
7465

75-
Adding
76-
```
77-
import elementJpLocale from 'element-ui/lib/locale/lang/jp' // element-ui lang`
66+
3. Edit `index.js` while keeping it's current structure, adding:
7867

79-
import jpLocale from “./jp_JP”;
80-
jp_JP: {
81-
... jpLocale,
82-
... elementJpLocale
83-
}
84-
```
85-
4. Add your language to the other `.js` files (within the `lang: {` section):
68+
```js
69+
import elementJpLocale from 'element-ui/lib/locale/lang/jp' // element-ui
70+
lang import jpLocale from './jp_JP' elementJpLocale
71+
```
8672

87-
`jp: '日本語',`
88-
5. Add your langaguge to the `web/src/App.vue` file:
73+
And extending `messages`:
8974

90-
```
75+
```js
76+
jp_JP: {
77+
...jpLocale,
78+
...elementJpLocale,
79+
},
80+
```
81+
82+
4. Add your language to the other `.js` files (within the `lang: {` section):
83+
84+
`vuejp: '日本語',`
85+
86+
5. Add your language to the `web/src/App.vue` file:
87+
88+
```js
9189
<el-dropdown-item Enabled="language==='jp'" command="jp" divided>
92-
{{ $t('lang.jp') }}
90+
{{ $t('lang.jp') }}
9391
</el-dropdown-item>
94-
```
92+
```

0 commit comments

Comments
 (0)