Hello!

I have written on Sunday,  3 May, at 12:14:
>Eike Rathke has written on Saturday,  2 May, at 23:58:
>>On Saturday, 2015-05-02 13:32:23 +0100, acefael wrote:

>>> [...]
>>> +"Many others not mentioned here contributed code, fixes," ,
>>> +"and suggestions." };
>>>  
>>> -      puts (_(Copyright));
>>> +      {
>>> +        int csize = sizeof(Copyright)/sizeof(Copyright[0]);
>>> +        int i;
>>> +        for( i = 0 ; i < csize ; ++i ) {
>>> +          puts (_(Copyright[i]));
>>> +        }
>>> +      }

>>What you may not be aware of, the _() underscore function is a special
>>function for the gettext() translation process. AFAIK it does not work
>>with array elements this way (someone correct me if I'm wrong).

>    You are wrong. It works exactly that way. Although strings which are
>passed to invocation of _() should be marked for translation elsewhere by
>enclosing them into N_() which cannot translate static string, of course,
>but only marks the string. In the case above each element of Copyright[]
>array should be enclosed in N_() to be translated by _().

    Although looking at the code again I'm afraid it will never work
since _(Copyright) and _(Copyright[i]) cannot be called at the same
program, because _() requires (char *) argument and if Copyright is a
(char *) array then _(Copyright[i]) will not work but if Copyright is
a (char **) array then _(Copyright) will not work. Therefore a whole
quoted code will fail to compile unless you supress errors, but if it
compiles then it would crash at runtime.

    With best regards,
    Andriy.

Reply via email to