[I18n-sig] Help with getText lib

Michel Martin michel.martin at usherbrooke.ca
Thu Dec 11 16:11:21 EST 2003


I have difficulty using getText. In fact, I'm able to create my .po files and my
.mo files. But I'm not able to read/retrieve them using either
"gettext.install(...)" or  "gettext.find(...)".

Does any one have a complete example on how to use getText in a python application?

Here are the details of my work...

I use Windows2000 Pro and Python 2.3
My dev path is c:\dev
My python file is c:\dev\ which contains:
=================
import gettext
gettext.install('dev', 'c:\dev\locale', unicode=1)
print _('Hello world!')
=================

My .mo file is C:\dev\locale\en\LC_MESSAGES\dev.mo which came from
My .po file is C:\dev\locale\en\LC_MESSAGES\dev.po which contains
=================
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: Thu Dec 11 13:34:28 2003\n"
"PO-Revision-Date: 2003-12-11 13:39-0500\n"
"Last-Translator: Mr. Sm:)e <mister_smile at hotmail.com>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#
msgid "Hello world!"
msgstr "Does it work?!!!!!!!!"
=================

Please reply with my email address in CC.

Thank you for your help,
Best regards

Michel Martin
michel.martin at usherbrooke.ca



More information about the I18n-sig mailing list