2 Translate Mizar
Fabio Di Stasio edited this page 2023-04-18 17:54:17 +02:00

The developer's way

  1. Fork 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, minus (-) and 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:
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
}
  1. 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'
};
  1. Save and run npm i & npm run debug in mizar folder.
  2. In Mizar app just opened go to setting, select your brand new translation and test that everything works.
  3. Commit and make a pull request on this repo!

The fast way

  1. Download this file.
  2. 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, minus (-) and ISO 3166-2 (eg. fr-FR).
  4. Open a new issue 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 and message groups.
  2. Open the file en-US.ts, scroll until you find the properties of word and message 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.