sorting translation entries

Carlos Perelló Marín carlos.perello at
Tue Jan 4 08:18:53 CST 2005

On Sun, 2005-01-02 at 12:52 +0100, Valient Gough wrote:
> I've been sorting my translation strings (POT file) in rough order by 
> most desired translations first, so translators will see them first in 
> Rosetta.  I don't know how Rosetta plans on dealing with sorting (if at 
> all), so I'll describe how I've handled it for my project.

At this moment, Rosetta sorts the strings in the same order the .pot
file have them.

> I use comments in front of the translation strings to specify sort order 
> using a small perl script po-group ( 
> which parses a po file and sorts it based on the comments.  The comment 
> that po-group sorts by is "xgroup([group name])".  For example, in my 
> code I have tagged various common strings like this:
>     // xgroup(common)
>     printf( _("hello world") );
> A couple changes are then required in the po/ (from the 
> default gettext setup):
> - gettext's template Makefile uses the option 
> "--add-comments=TRANSLATORS:" , which I replaced with just 
> "--add-comments", so that all the comments preceeding a translated 
> string will be pulled into the .pot file.
> - po-group also needs to be automatically run.  In the gettext default 
>, there are two places where the .pot file is created as a 
> temporary file and then moved to the final location with "mv 
> $(DOMAIN).po $(srcdir)/$(DOMAIN).pot;"  I replaced both those with  
> "./po-group sort $(DOMAIN).po > $(srcdir)/$(DOMAIN).pot;"
> The disadvantage of this scheme is that it is intrusive -- it requires 
> that you add comments to mark the most important strings, and you make 
> po-group get run from the makefile.
> The advantage is that the sorting information will not go out-of-date 
> even if the string is modified, because it is kept in the same place as 
> the original string..

Sounds interesting but outside the scope of Rosetta, have you thought
about propose it to gnu gettext developers so xgettext implements it
automatically and you don't need to do any change?


> regards,
> Valient

Carlos Perelló Marín
Ubuntu Warty (PowerPC)  =>
mailto:carlos.perello at
Valencia - Spain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url :

More information about the rosetta-users mailing list