[GRASS-dev] Re: [GRASS-SVN] r48376 - in grass/trunk: lib/python lib/temporal temporal temporal/t.create temporal/t.time.abs temporal/t.time.rel

Glynn Clements glynn at gclements.plus.com
Tue Sep 20 23:29:45 EDT 2011


Martin Landa wrote:

> btw, the messages should be marked for translation. Also string
> substitutions is preferable, it's better for translators. In this case
> 
> core.error(_("Unable to remove space time dataset register table ") + self.get_stds_register())

Use:

core.error(_("Unable to remove space time dataset register table %s") % self.get_stds_register())

Using substitution allows the position of the subject/object to be
changed if that's appropriate for a particular language. Appending
means that it has to come at the end, which can sometimes require
contrived and/or grammatically incorrect translations.

If a string contains more than one substitution, it's better to use
the dictionary form, to allow the order to be changed. Unlike C's
printf(), Python doesn't support the "%1$s" notation.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list