Using txt2po
txt2po allows you to use the same principles of PO files with normal text
files. In PO only items that change are marked fuzzy and only new items need
to be translated, unchanged items remain unchanged for the translation.
Preparing input files
With txt2po a text file is broken down into sections. Each section is
seperated by a line of whitespace. Each section will appear as a msgid in the
PO file. Because of this simple method of breaking up the input file it might
be necisary to alter the layout of your input file. For instance you might
want to seperate a heading from a paragraph by using whitespace.
For steps in a process you would want to leave a blank line between each step
so that each step can be translated independently.
For a list of items you might want to group them together so that a translator
could for example place them in alphabetic order for their translation.
Once the input file is prepared you can proceed to the next step.
Creating the POT file
This is simple:
txt2po -i TEXT_FILE -o text_file.pot
A translator would then create translations of the entries in the POT file.
You might want to manually edit the POT file to remove items that shoudl not be
transalted. For instance if part of the document is a license you might want
to remove those if you do not want the license translated for legal reasons.
Translating
Translate as normal. However translators should be aware that writers of the
text file may have used spaces, dashes, equals, underscores and other aids to
indicate things such as:
* Headings and sub-headings
* Examples command lines
* Lists of times
* etc
They will need to adapt these to work in their language being aware of how they
will appear once they are merged with the original text document.
Creating a translated text file
With the translations complete you can create a translated text file like this:
po2txt -i translated.po -o TEXT_FILE.translated -t TEXT_FILE -w 75
This uses the original text file as input and creates a new translated text
file using the translations found in the PO file.
The -w command allows you to reflow the translated text to N number of
characters, otherwise the text will appear as one long line.