45 lines
2.1 KiB
Plaintext
45 lines
2.1 KiB
Plaintext
From the begining you need to have GNUgettext and PoEdit.
|
|
GNUgettext package contains a set of tools to extract strings from the source code and
|
|
to create the Catalog to translation.
|
|
PoEdit provide good interface for the translators.
|
|
|
|
Those are possible to download here:
|
|
GNUgettext - https://sourceforge.net/directory/os:windows/?q=gnu+gettext
|
|
PoEdit - https://poedit.net/
|
|
|
|
When GNUgettext and poEdit are downloaded and installationed, next step is
|
|
to add path to gettext/bin directory to your PATH variable.
|
|
You can use gettext from cmdline now.
|
|
|
|
|
|
In Slic3rPE we have one macro (L) used to markup strings to localizations.
|
|
|
|
So, to create Catalog to translation there are next steps:
|
|
1. create list of files with this macro (list.txt)
|
|
|
|
2. create template file(*.POT) with command:
|
|
xgettext --keyword=L --from-code=UTF-8 --debug -o Slic3rPE.pot -f list.txt
|
|
Use flag --from-code=UTF-8 to specify that the source strings are in UTF-8 encoding
|
|
Use flag --debug to correctly extract formated strings(used %d, %s etc.)
|
|
|
|
3.1 if you start to create PO-file for your projest just open this POT-file in PoEdit.
|
|
When you select translation language after first opening of POT-files,
|
|
PO-file will be created immediatly.
|
|
|
|
3.2 if you already have PO-file created before, you have to merge old PO-file with
|
|
strings from creaded POT-file. You can do that with command:
|
|
msgmerge -N -o new.po old.po new.pot
|
|
Use option -N to not using fuzzy matching when an exact match is not found.
|
|
|
|
3.3 if you already have PO-file created before and new PO-file created from new sourse files
|
|
which is not related with first one, you have to concatenate old PO-file with
|
|
strings from new PO-file. You can do that with command:
|
|
msgcat -o new.po old.po
|
|
|
|
4. create an English translation catalog with command:
|
|
msgen -o new.po old.po
|
|
Notice, in this Catalog it will be totally same strings for initial text and translated.
|
|
|
|
When you have Catalog to translation open POT or PO file in PoEdit and start to translation.
|
|
It's very important to keep attention to every gaps and punctuation. Especially with
|
|
formated strings. (used %d, %s etc.) |