Re: [RFC PATCH 1/3] config --global --edit: create a template file if needed

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

 



Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:

> Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:
>
>>> +static char *default_user_config()
>>> +{
>>> +       struct strbuf buf = STRBUF_INIT;
>>> +       strbuf_addf(&buf,
>>> +                   _("# This is Git's user-wide configuration file.\n"
>>> +                     "[core]\n"
>>> +                     "# Please, adapt and uncomment the following lines:\n"
>>> +                     "#        user = %s\n"
>>> +                     "#        email = %s\n"),
>>
>> "[core]", "user =", "email =" should not be translated. Would it make
>> sense to keep these outside of _()?
>
> I would say no, as the code and the string to translate would be much
> less readable without core, user and email inline.
>
> Were you suggesting stg like
>
> _("# This is Git's user-wide configuration file.\n"
>   "[%s]\n"
>   "# Please, adapt and uncomment the following lines:\n"
>   "#        %s = %s\n"
>   "#        %s = %s\n"),
>   "core", "name", ..., "email", ...
>
> ?

;-) That is a clever way to say what my first reaction to Eric's
comment was, which was to have this as multiple strbuf_addf().

Technically speaking, the '#' at the beginning of lines must not be
translated, either, and if that goes without saying, i.e. if the
translators know well enough not to change them, then I can be
persuaded that we can expect that translators know well enough not
to touch the three substrings Eric pointed out.

So, the original message may be fine as-is.

>>> +                       if (fd) {
>>> +                               char *content = default_user_config();
>>> +                               write_str_in_full(fd, content);
>>
>> close(fd);
>
> Indeed.
>
>>> +                               free(content);
>>> +                       }
>>> +                       else if (errno != EEXIST)
>>> +                               die_errno(_("Cannot create configuration file %s"), config_file);
>>
>> Other error messages in this file (including those just above this
>> block) begin with a lowercase letter.
>
> Applied.
>
> Thanks,
--
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]