mirror of
https://github.com/Fabio286/mizar.git
synced 2024-12-21 12:34:23 +01:00
Page:
Translate Mizar
2
Translate Mizar
Fabio Di Stasio edited this page 2023-04-18 17:54:17 +02:00
The developer's way
- Fork this repo and clone the forked copy on your machine.
- Open
mizar
folder with your editor of choice. - Go to
mizar/src/renderer/i18n/
. - Create a copy of
en-US.ts
and rename with your locale shortcode composed by ISO 639-1, minus (-
) and ISO 3166-2 (eg. it-IT). - On first line rename
export const enUS
inexport const (locale shortcode without '-')
. - Translate all strings contained in this new file. Make sure to not delete
{variables}
or|
. - In the same folder, edit
index.ts
, import the new translation and add a key: value pair like follow:
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
}
- In the same folder, edit
supported-locales.js
to add a key: value pair with'short-code': 'Language Name in original language'
as follow:
export default {
'en-US': 'English',// <- do not forget comma on the line above your new locale
'it-IT': 'Italiano'
};
- Save and run
npm i
&npm run debug
inmizar
folder. - In Mizar app just opened go to setting, select your brand new translation and test that everything works.
- Commit and make a pull request on this repo!
The fast way
- Download this file.
- Translate all strings contained in this file. Make sure to not delete
{variables}
or|
. - Rename it with your locale shortcode composed by ISO 639-1, minus (
-
) and ISO 3166-2 (eg. fr-FR). - Open a new issue with title "New Translation: {Locale name in original language}".
- 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.
- Submit.
Update an existing translation
To update an existing translation, one must first add missing words and messages and then proceed with the translation.
- Open the translation file you want to update and check what is the latest translation of the
word
andmessage
groups. - Open the file
en-US.ts
, scroll until you find the properties ofword
andmessage
present after the last one translated and copy and paste them into the relevant groups in the file you are translating. - 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.