mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
add guides for localization
This commit is contained in:
parent
7e11519b9b
commit
53d1e72f31
44
en_us/docs/Developers/Localization and Translations.md
Normal file
44
en_us/docs/Developers/Localization and Translations.md
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Localization and Translations
|
||||||
|
For now, VNote only supports English and Simplified Chinese as interface's language. A Japanese translation is provided by VNote's users. It is highly appreciated to help us translate VNote to other languages.
|
||||||
|
|
||||||
|
To provide translations for VNote, you only need to download VNote's source code and get Qt installed. You do not need the environment to build VNote. What we need at last for a new locale are just two files: `*.ts` and `*.qm`.
|
||||||
|
|
||||||
|
## Tools from Qt
|
||||||
|
After installing Qt, there are two tools we need in `path_to_Qt/bin` folder: `lupdate` and `linguist`.
|
||||||
|
|
||||||
|
## Add ts file
|
||||||
|
Given that we want to provide a Traditional Chinese translation for VNote. The locale code should be `zh_HK`. First we add one empty plain text file `src/translations/vnote_zh_HK.ts` under VNote's source code.
|
||||||
|
|
||||||
|
Then add it to `src/src.pro` file:
|
||||||
|
|
||||||
|
```pro
|
||||||
|
TRANSLATIONS += translations/vnote_zh_CN.ts \
|
||||||
|
translations/vnote_ja.ts \
|
||||||
|
translations/vnote_zh_HK.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update ts file
|
||||||
|
Now we need to update `vnote_zh_HK.ts` according to latest source code via `lupdate` tool.
|
||||||
|
|
||||||
|
Execute `lupdate` update VNote's source code root folder:
|
||||||
|
|
||||||
|
```
|
||||||
|
lupdate VNote.pro
|
||||||
|
```
|
||||||
|
|
||||||
|
It will fill in `vnote_zh_HK.ts` with latest strings need to translate.
|
||||||
|
|
||||||
|
## Fill in ts file with translations
|
||||||
|
```
|
||||||
|
linguist src/translations/vnote_zh_HK.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
This will open Linguist tool for us to do the translation one by one.
|
||||||
|
|
||||||
|
After doing all the translations, select `Save` and `Release` in the `File` menu of Linguist. The `vnote_zh_HK.qm` file should now be generated along side with the ts file.
|
||||||
|
|
||||||
|
## Submit files
|
||||||
|
Now you could submit those two files to the author. The author will integrate them in next release of VNote.
|
||||||
|
|
||||||
|
## Update after changes
|
||||||
|
You need to update the `ts` and `qm` file if there are changes in source code via `lupdate` and `linguist`.
|
@ -10,6 +10,16 @@
|
|||||||
"name": "Build VNote.md",
|
"name": "Build VNote.md",
|
||||||
"tags": [
|
"tags": [
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"attachment_folder": "",
|
||||||
|
"attachments": [
|
||||||
|
],
|
||||||
|
"created_time": "2019-03-31T07:23:55Z",
|
||||||
|
"modified_time": "2019-03-31T07:44:16Z",
|
||||||
|
"name": "Localization and Translations.md",
|
||||||
|
"tags": [
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sub_directories": [
|
"sub_directories": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user