Skip to content

Manual Translation

Vasily Elkin edited this page Jun 24, 2022 · 2 revisions

New locale

To make a new locale for MKS WiFi Plugin you will need:

  • Some linguist app (e.g. Poedit).

Steps:

  1. Create new directory with locale name in i18n directory of the plugin (e.g. ru_RU) (must be named as Cura ones);
  2. Open mksplugin.pot in linguist app and create a new translation file mksplugin.po in created locale directory;
  3. Translate everything you need in this translation;
  4. Create new directory named LC_MESSAGES in your locale directory;
  5. Compile mksplugin.mo from mksplugin.po and place it in LC_MESSAGES directory;
  6. Now if your Cura locale is switched to your newly compiled locale the plugin must be translated.

Improve translation

To improve existing locale for MKS WiFi Plugin you will need:

  • Some linguist app (e.g. Poedit).

Steps:

  1. Open mksplugin.po of the locale needed to be improved;
  2. Correct everything you need;
  3. Save mksplugin.po;
  4. Compile mksplugin.mo and place it in [plugin directory]/i18n/[locale directory]/LC_MESSAGES directory.

How to make changes in mksplugin.pot file?

To make this you will need:

  • Installed gettext package.

Steps:

  1. Make needed changes in source codes;
  2. Open terminal and go to plugin directory;
  3. Execute xgettext --package-name='MKS WiFi Plugin' --from-code=UTF-8 --language=python -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -o i18n/mksplugin.pot $(find -L . -name \*.py) and xgettext --package-name='MKS WiFi Plugin' --from-code=UTF-8 --join-existing --language=javascript -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -o i18n/mksplugin.pot $(find -L qml -name \*.qml);
  4. Now mksplugin.pot should be ready;

How to update mksplugin.po file from mksplugin.pot file?

To make this you will need:

  • Installed gettext package.

Steps:

  1. Go to [plugin directory]/i18n;
  2. Execute msgmerge --update ru_RU/mksplugin.po mksplugin.pot.

How to create mksplugin.po without a linguist app

To make this you will need:

  • Installed gettext package.

Steps:

  1. Go to [plugin directory]/i18n;
  2. Execute msginit --input=mksplugin.pot --locale=ru_RU --output=ru_RU/mksplugin.po.

How to compile mksplugin.mo without a linguist app

To make this you will need:

  • Installed gettext package.

Steps:

  1. Go to [plugin directory]/i18n/[locale directory];
  2. Create LC_MESSAGES directory;
  3. Execute msgfmt mksplugin.po -o LC_MESSAGES/mksplugin.mo.