-
-
Notifications
You must be signed in to change notification settings - Fork 56
Manual Translation
Vasily Elkin edited this page Jun 24, 2022
·
2 revisions
To make a new locale for MKS WiFi Plugin you will need:
- Some linguist app (e.g. Poedit).
Steps:
- Create new directory with locale name in
i18n
directory of the plugin (e.g. ru_RU) (must be named as Cura ones); - Open
mksplugin.pot
in linguist app and create a new translation filemksplugin.po
in created locale directory; - Translate everything you need in this translation;
- Create new directory named
LC_MESSAGES
in your locale directory; - Compile
mksplugin.mo
frommksplugin.po
and place it inLC_MESSAGES
directory; - Now if your Cura locale is switched to your newly compiled locale the plugin must be translated.
To improve existing locale for MKS WiFi Plugin you will need:
- Some linguist app (e.g. Poedit).
Steps:
- Open
mksplugin.po
of the locale needed to be improved; - Correct everything you need;
- Save
mksplugin.po
; - Compile
mksplugin.mo
and place it in [plugin directory]/i18n/[locale directory]/LC_MESSAGES directory.
To make this you will need:
- Installed gettext package.
Steps:
- Make needed changes in source codes;
- Open terminal and go to plugin directory;
- 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)
andxgettext --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)
; - Now
mksplugin.pot
should be ready;
To make this you will need:
- Installed gettext package.
Steps:
- Go to [plugin directory]/i18n;
- Execute
msgmerge --update ru_RU/mksplugin.po mksplugin.pot
.
To make this you will need:
- Installed gettext package.
Steps:
- Go to [plugin directory]/i18n;
- Execute
msginit --input=mksplugin.pot --locale=ru_RU --output=ru_RU/mksplugin.po
.
To make this you will need:
- Installed gettext package.
Steps:
- Go to [plugin directory]/i18n/[locale directory];
- Create
LC_MESSAGES
directory; - Execute
msgfmt mksplugin.po -o LC_MESSAGES/mksplugin.mo
.