1. Preparing the source
To make a script translatable you must first add these two lines to the rc script.
TEXTDOMAIN=my_service
TEXTDOMAINDIR=/lib/initscripts/messages
To mark a string as translatable in bash you must prefix the string with $.
echo $"This is a translatable string."
2. Creating the pot file
After this you must create the pot file.
$ bash --dump-po-strings rc.my_service | xgettext -L PO -o rc.my_service.pot -
3. Creating a po file
In the next step you create the po file.
$ msginit -l hu_HU
Now you can edit the po file with any editor.
4. Creating the mo files
To create and install the mo files, you must add the po files to the source()
array and use the Frcd2
macro in build().