Re: [PATCH v2 1/2] object.[ch]: mark object type names for translation
- From
Jeff King <peff@peff.net>
- Date
- Oct 6, 2021, 20:38 UTC
- Message-ID
- <YV4JQytrc9UTa22o@coredump.intra.peff.net>
- In-Reply-To
- <xmqqv92aq6m3.fsf@gitster.g>
On Wed, Oct 06, 2021 at 12:46:12PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes: > > > 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