Converts Windows Resource .rc files to Gettext PO format.
rc2po [options] <rc> <po>
po2rc [options] -t <rc> <po> <rc>
Where:
<rc> |
is a valid Windows Resource file or directory of those files |
<po> |
is a directory of PO or POT files |
Options (rc2po):
show program’s version number and exit
show this help message and exit
output a manpage based on the help
show progress as: dots, none, bar, names, verbose
show errorlevel as: none, message, exception, traceback
read from INPUT in rc format
exclude names matching EXCLUDE from input paths
write to OUTPUT in po, pot formats
read from TEMPLATE in rc format
skip conversion if the output file has newer timestamp
output PO Templates (.pot) rather than PO files (.po)
charset to use to decode the RC files (default: cp1252)
LANG entry (default: LANG_ENGLISH)
SUBLANG entry (default: SUBLANG_DEFAULT)
what to do with duplicate strings (identical source text): merge, msgctxt (default: ‘msgctxt’)
Options (po2rc):
show program’s version number and exit
show this help message and exit
output a manpage based on the help
show progress as: dots, none, bar, names, verbose
show errorlevel as: none, message, exception, traceback
read from INPUT in po, pot formats
exclude names matching EXCLUDE from input paths
write to OUTPUT in rc format
read from TEMPLATE in rc format
skip conversion if the output file has newer timestamp
charset to use to decode the RC files (default: utf-8)
LANG entry
SUBLANG entry (default: SUBLANG_DEFAULT)
only convert files where the translation completion is above PERCENT
use translations marked fuzzy
don’t use translations marked fuzzy (default)
Note
This implementation is based mostly on observing WINE .rc files, these should mimic other non-WINE .rc files.
This example looks at roundtrip of Windows Resource translations as well as recovery of existing translations.
First we need to create a set of POT files.
rc2po -P lang/ pot/
All .rc files found in the lang/
directory are converted to Gettext POT
files and placed in the pot/
directory.
If you are translating for the first time then you can skip the next step. If you need to recovery your existing translations then we do the following:
rc2po -t lang zu po-zu/
Using the English .rc files found in lang
and your existing Zulu
translation in zu
we create a set of PO files in po-zu
. These will now
have your translations. Please be aware that in order for the to work 100% you
need to have both English and Zulu at the same revision, if they are not you
will have to review all translations. Also the .rc files may be in different
encoding, we cannot at the moment process files of different encodings and
assume both are in the same encoding supplied.
You are now in a position to translate your recovered translations or your new POT files.
Once translated you can convert back as follows:
po2rc -t lang/ po-zu/ zu/
Your translations found in the Zulu PO directory, po-zu
, will be converted
to .rc using the files in lang/
as templates and placing your new
translations in zu/
.
To update your translations simply redo the POT creation step and make use of pot2po to bring your translation up-to-date.
If you are recovering translation using rc2po -t en.rc xx.rc xx.po
then
both en.rc and xx.rc need to be in the same encoding.
There might be problems with MENUs that are deaply nested.