blino's website

Free software developer and more

Since we use HTML in our first time desktop wizard (and in the new first boot wizard), it may be useful to use standard translations methods such as xgettext and po files.

intltool comes handy here, since it can handle XML files (Translating Custom XML). This also works with HTML files, it just requires translatables strings to be enclosed in tags with an '_' prefix.

$ cat >

$ intltool-extract --type=gettext/xml 
Generating C format header file for translation.

$ mkdir po
$ xgettext -a -o po/foo.pot
$ cp -a po/foo.pot po/fr.po

$ emacs po/fr.po # edit po/fr.po

$ intltool-merge --xml-style -m po foo.html
Merging translations into foo.html.
CREATED fr/foo.html
CREATED foo.html

$ cat fr/foo.html
<?xml version="1.0" encoding="UTF-8"?>
<head><title xml:lang="fr">Moyoto</title></head>
<body><span xml:lang="fr">\o/</span></body>

Comments are closed for this story.

Trackbacks are closed for this story.

blosxom Optimised for standards.
Olivier Blin (2005)