Hi,
Regarding the use of gettext, here is a example on Xorgwizard
-localized in french, if you update your "dialog" utility, everything could work fine, otherwise you may have some issue with UTF-8 french characters.
Process applied to build the localized xorgwizard:
1-Modification of /usr/sbin/xorgwizard:
-at the begining of the script insertion of:
Code: Select all
TEXTDOMAINDIR=/usr/share/locale
TEXTDOMAIN=xorgwizard
export TEXTDOMAINDIR
export TEXTDOMAIN
-then every text to be translated is called with gettext,
as in the example:
becomes:
2-extract text abstract to be translated:
Code: Select all
xgettext --language=shell -o - /usr/sbin/xorgwizard > ~/xorgwizard.po
3-translate , for that you can edit the po file with your prefered editor.
But you could use any tool specialized for po catalogs such as poedit which can be compiled with gtkspell -with wxwidgets as dependency. poedit also builds the mo file everytime the po file is saved. ... You get a nice GUI, and translation tools.
4-build the mo file from the po file and put it in your language folder:
Code: Select all
msgfmt -o /usr/share/locale/fr/LC_MESSAGES/xorgwizard.mo ~/xorgwizard.po
You will find the resulting pet package in attachment. the po file in the root folder is useless, it's just here for the example.
Note that french special characters are displayed ok,
some were not (uppercase ones),
and the right edge of the "dialog" frame was distorted as reported by maddox,
but updating dialog solved almost all these problem (thanks MU)
- I took the version inside the slackware 12.2 repository, just a
remaining issue with this one
Code: Select all
È È È È Capital E-grave
Afterward, if some modifications are made to the script,
you have to extract the new text field in a new file:
xgettext --language=shell -o - /usr/sbin/xorgwizard > ~/xorgwizard.pot
and merge it with your previous translation:
msgmerge --update ~/xorgwizard.po ~/xorgwizard.pot
and you will keep your previous translation inside the po file, plus the
extra fields and notification on modified ones, then you can start again from translation step 3, above.
This is just an example, they are surely few mistakes in it, and I just tried in french, so probably still few issues unmet and then unsolved.
infomation mostly extracted from:
http://bash-hackers.org/wiki/doku.php/m ... ashfaq/098
http://tldp.org/LDP/abs/html/localization.html
http://www.poedit.net