Re: [PATCH 01/72] gettext.h: add no-op _() and N_() wrappers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Erik Faye-Lund wrote:
> On Sun, Feb 20, 2011 at 3:01 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
>> Ãvar ArnfjÃrà Bjarmason wrote:

>>> +#define N_(s) (s)
>>
>> Might be nice to make this an inline function, for type safety.
>>
>>> +#define _(s) (s)
>>
>> This one can't be a function, though, since it needs to transform
>> literals to literals.
[...]
>> +/* Mark msgid for translation but do not translate it. */
>> +#define N_(msgid) (msgid)
>
> Isn't this the opposite of what you suggested above?

Agh.  I mixed up the snippets from Ãvarâs message.

N_ needs to take literals to literals, so even the non-stub version would
be defined as

	#define N_(msgid) (msgid)

for use in contexts like

	const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
		/* ERROR_WOULD_OVERWRITE */
		N_("Entry '%s' would be overwritten by merge. Cannot merge."),

		/* ERROR_NOT_UPTODATE_FILE */
		N_("Entry '%s' not uptodate. Cannot merge."),
	[...]

Meanwhile, in the non-stub version, _ is a synonym for the gettext()
function.

Sorry for the noise.
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]