[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Correct management of .po files for translation

On Wed, Apr 04, 2007 at 05:31:16PM +0100, Ewan Mellor wrote:
> On Wed, Apr 04, 2007 at 05:02:23PM +0100, Daniel P. Berrange wrote:
> > Basically the code is abusing the gettext translation service to do both the
> > constant -> string conversion & the translation in one go. The normal way to
> > do the constant -> string conversion is to have a statically declared hash
> > table in the application itself. This contains the master english strings
> > annotated with  N_(...string..).  The xgettext program will then generate
> > the .pot files automatically in the correct format.
> > 
> > I'm attaching an example to show how this ought to work in the Xen case.
> > The makefiles could be hooked up to automatically run
> > 
> >   xgettext --keyword=N_ -o xen-xm.pot tools/python/xen/xm/XenAPI.py
> Sounds good to me, Daniel, thanks.  Could you write a patch to hook up the
> Makefiles as well?  I reckon we'll be able to sneak this one in for 3.0.5 if
> you did.

I'm attaching a patch which hooks up the tools/python/Makefile to update
the master xen-xm.pot file with new translatable text on every biuld, and
to merge these into any translations. The install rule was tweaked to deal
with the different build process.

There is no actual language translation in the patch - when adding new 
translations simply 

   cd xen/xm/messages
   cp xen-xm.pot fr_FR.po
   vi fr_FR.po

Also edit tools/python/Makefile to add the language code 'fr_FR' to the
LINGUAS makefile variable.

NB, since I don't have a current xen-unstable.hg kernel build operational
on my dev hardware currently I've not yet been able to test the correct
operational of the XenAPI.py changes in this patch. Hopefully I'll be able
to get a working kernel on this machine soon

 a/tools/python/xen/xm/messages/en/xen-xm.po |   69 ----------------------------
 b/tools/python/remove-potcdate.sed          |   19 +++++++
 b/tools/python/xen/xm/messages/xen-xm.pot   |   63 +++++++++++++++++++++++++
 config/StdGNU.mk                            |    1 
 tools/python/Makefile                       |   68 ++++++++++++++++++++++-----
 tools/python/xen/xm/XenAPI.py               |   18 ++++++-
 7 files changed, 218 insertions(+), 83 deletions(-)

   Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-gettext.patch
Description: Text document

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.