Thread (2 messages) flat view 2 messages, 2 authors, 2021-10-06

Re: [PATCH v2 1/2] object.[ch]: mark object type names for translation

From: Jeff King <hidden>
Date: 2021-10-06 20:38:32

On Wed, Oct 06, 2021 at 12:46:12PM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
They all appear to want is as a noun. So maybe this is just
mis-translated for Spanish. It does feel like an accident in the making,
though.
Probably we need pgettext().

https://www.gnu.org/software/gettext/manual/html_node/Contexts.html
Yeah, that make sense. I'm not sure how it interacts with N_(), though.
I.e., I'd expect the "context" to ride along with the original string,
but I guess it is really in the caller who's translating it. So the real
spot becomes:

  printf(_("my type is %s"), pgettext("object-type", type_name(type)));

It's a little unfortunate that every caller has to do it rather than
putting it near the source string. But I guess a type_name_human() would
solve that, too. ;)

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help