mirror of
https://github.com/Fabio286/mizar.git
synced 2025-01-03 10:29:31 +01:00
Created Translate Mizar (markdown)
parent
758d9c3321
commit
0add69075b
49
Translate-Mizar.md
Normal file
49
Translate-Mizar.md
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
## The developer's way
|
||||||
|
|
||||||
|
1) [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) this repo and clone the forked copy on your machine.
|
||||||
|
2) Open `mizar` folder with your editor of choice.
|
||||||
|
3) Go to `mizar/src/renderer/i18n/`.
|
||||||
|
4) Create a copy of `en-US.ts` and rename with your locale shortcode composed by [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), minus (`-`) and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) (eg. it-IT).
|
||||||
|
5) On first line rename `export const enUS` in `export const (locale shortcode without '-')`.
|
||||||
|
6) Translate all strings contained in this new file. Make sure to not delete `{variables}` or `|`.
|
||||||
|
7) In the same folder, edit `index.ts`, import the new translation and add a key: value pair like follow:
|
||||||
|
```ts
|
||||||
|
import { enUS } from './en-US';
|
||||||
|
import { itIT } from './it-IT';
|
||||||
|
|
||||||
|
messages: {
|
||||||
|
'en-US': enUS,// <- do not forget comma on the line above your new locale
|
||||||
|
'it-IT': itIT
|
||||||
|
}
|
||||||
|
```
|
||||||
|
7) In the same folder, edit `supported-locales.js` to add a key: value pair with `'short-code': 'Language Name in original language'` as follow:
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
'en-US': 'English',// <- do not forget comma on the line above your new locale
|
||||||
|
'it-IT': 'Italiano'
|
||||||
|
};
|
||||||
|
```
|
||||||
|
8) Save and run `npm i` & `npm run debug` in `mizar` folder.
|
||||||
|
9) In Mizar app just opened go to setting, select your brand new translation and test that everything works.
|
||||||
|
10) Commit and make a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) on this repo!
|
||||||
|
|
||||||
|
## The fast way
|
||||||
|
|
||||||
|
1) Download [this file](https://raw.githubusercontent.com/fabio286/mizar/master/src/renderer/i18n/en-US.ts).
|
||||||
|
5) Translate all strings contained in this file. Make sure to not delete `{variables}` or `|`.
|
||||||
|
3) Rename it with your locale shortcode composed by [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), minus (`-`) and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) (eg. fr-FR).
|
||||||
|
4) Open a [new issue](https://github.com/fabio286/mizar/issues) with title "New Translation: {Locale name in original language}".
|
||||||
|
5) Drag the file in the issue, write your name and the link to your Github profile (if you want), i'll add in README.md.
|
||||||
|
6) Submit.
|
||||||
|
|
||||||
|
## Update an existing translation
|
||||||
|
|
||||||
|
To update an existing translation, one must first add missing words and messages and then proceed with the translation.
|
||||||
|
|
||||||
|
1) Open the translation file you want to update and check what is the latest translation of the `word`, `message` and `faker` groups.
|
||||||
|
2) Open the file `en-US.ts`, scroll until you find the properties of `word`, `message` and `faker` present after the last one translated and copy and paste them into the relevant groups in the file you are translating.
|
||||||
|
3) Translate strings and send the updated translation in one of the above ways.
|
||||||
|
|
||||||
|
## Problems with translation?
|
||||||
|
|
||||||
|
Do not hesitate to contact me at fabio286@gmail.com for any questions or if you have problems with the translation procedure.
|
Loading…
Reference in New Issue
Block a user