Sample python program: [CGI script, so it needs to select its own language rather than using whatever the host OS is set to]
import gettext
gettext.install('test', "./locale")
_ = gettext.gettext
t = gettext.translation('test', "./locale", languages=['fr'])
t.install()
print _("Hello world")
./locale/fr/LC_messages/test.mo contains the translation (as binary file, generated by running msgfmt on a .po file).
Program prints "Hello world" instead of the translated version. What could be the problem?