[PATCH 2 of 5] log: use new namespaces api to display names

Matt Mackall mpm at selenic.com
Fri Jan 23 17:07:53 CST 2015


On Fri, 2015-01-23 at 20:43 -0200, Wagner Bruna wrote:
> Just noted an i18n issue with this change (pushed as

> > It's worth mentioning that the log output is still translated the same as
> > before since we are formating our strings the same way:
> >
> > # i18n: column positioning for "hg log"
> > _("bookmark:    %s\n") % bookmark
> > becomes
> >
> > tname = _(("%s:" % ns.templatename).ljust(13) + "%s\n") % name
> >

> But translatable strings are extracted from the source code too, by parsing 
> those _() calls with hggettext (see "%.po" Makefile target). So we need 
> _("tag:"), _("bookmark:"), etc. somewhere in the code, or translators won't 
> even notice they need translating (I only noticed myself because I run stable 
> tip from sources, and supposedly completed pt_BR a few days ago).

Joy. Yeah, this is a problem.

As a stop-gap for 3.3, we should probably change this:

	n = namespace("bookmarks", templatename="bookmark", listnames=bmknames,
                      namemap=bmknamemap, nodemap=bmknodemap)

to:

	# i18n: column positioning for "hg log"
	n = namespace("bookmarks", templatename="bookmark",
                 logfield=_("bookmark:    %s\n"),
		 listnames=bmknames, namemap=bmknamemap, nodemap=bmknodemap)

and if we have other uses for the translated field name, we can extract them with split(':').

(Note the reintroduction of the comment, which ends up in the .po file.)

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list