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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Matthieu Moy <hidden>
Date: 2016-06-15 23:02:02

Eric Sunshine [off-list ref] writes:
quoted
+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", ...

?
quoted
+                       if (fd) {
+                               char *content = default_user_config();
+                               write_str_in_full(fd, content);
close(fd);
Indeed.
quoted
+                               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,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:02:02

On Fri, Jul 25, 2014 at 12:01 PM, Matthieu Moy
[off-list ref] wrote:
Eric Sunshine [off-list ref] writes:
quoted
quoted
+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 or some equivalent variation. I'm not a translator, but the above
seems to convey sufficient context for a translator to understand what
needs to be said, while preventing accidental translations of those
strings which should not be translated.
quoted
quoted
+                       if (fd) {
+                               char *content = default_user_config();
+                               write_str_in_full(fd, content);
close(fd);
Indeed.
quoted
quoted
+                               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,

--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help