git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Remi Galan Alfonso <remi.galan-alfonso@ensimag.grenoble-inp.fr>
To: elena petrashen <elena.petrashen@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3][Outreachy] branch -D: allow - as abbreviation of @{-1}
Date: Wed, 6 Apr 2016 22:05:19 +0200 (CEST)	[thread overview]
Message-ID: <980248197.3116219.1459973119988.JavaMail.zimbra@ensimag.grenoble-inp.fr> (raw)
In-Reply-To: <CAJPOeMeAQVR9ZvEC+r24P-RZq46iAeVx3CrLNbGXBGE8jw-iUA@mail.gmail.com>

elena petrashen <elena.petrashen@gmail.com> wrote:
> On Tue, Apr 5, 2016 at 12:53 AM, Remi Galan Alfonso
> <remi.galan-alfonso@ensimag.grenoble-inp.fr> wrote:
> > elena petrashen <elena.petrashen@gmail.com> wrote:
> >> On Thu, Mar 31, 2016 at 6:31 PM, Remi Galan Alfonso
> >> <remi.galan-alfonso@ensimag.grenoble-inp.fr> wrote:
> >> > Elena Petrashen <elena.petrashen@gmail.com> wrote:
> >> >> +void delete_branch_advice(const char *name, const char *ref)
> >> >> +{
> >> >> +        const char fmt[] =
> >> >> +        "\nNote: to restore the deleted branch:\n\ngit branch %s %s\n";
> >> >
> >> > Shouldn't that be marked for translation, like is done with the other
> >> > strings?
> >> >
> >> > Thanks,
> >> > Rémi
> >>
> >> Thank you for letting me know about that! Could you please
> >> help me out and explain how do I mark it for translation? I tried
> >> to do it the same way as with the other strings but evidently
> >> didn't quite succeed.
> >
> > I am not sure.
> > I tried to grep similar cases, it seems that you can do the following:
> >
> >         const char fmt[] = N_("\nNote: to restore [...] \ngit branch %s %s\n");
> >         fprintf(stderr, _(fmt), name, ref);
> >
> > Some similar example in builtin/add.c:
> >
> >         static const char ignore_error[] =
> >         N_("The following paths are ignored by one of your .gitignore files:\n");
> >         [...]
> >                         fprintf(stderr, _(ignore_error));
> >
> > Or you can define fmt as a 'const char *' and in that case do the
> > following:
> >
> >         const char *fmt = _("\nNote: to restore [...] \n git branch %s %s\n");
> >         fprintf(stderr, fmt, name, ref);
> >
> >
> > In builtin/am.c:
> >                 const char *invalid_line = _("Malformed input line: '%s'.");
> >         [...]
> >                                 ret = error(invalid_line, sb.buf);
> >
> > I don't know which one is the best way to go though.
> >
> > Thanks,
> > Rémi
> 
> Thank you! I'm a bit confused though as the previous implemented advice function
> in advice.c (the one I used for reference) doesn't seem to employ this... does
> this mean it's also not marked for translation?
> 
> void detach_advice(const char *new_name)
> {
> const char fmt[] =
> "Note: checking out '%s'.\n\n"
> "You are in 'detached HEAD' state. <.........>Example:\n\n"
> "  git checkout -b <new-branch-name>\n\n";
> 
> fprintf(stderr, fmt, new_name);
> }

It doesn't seem so, at least it doesn't translate:

# $ LANG=fr_FR.UTF-8 git checkout 9494c39
# Note: checking out '9494c39'.
# 
# You are in 'detached HEAD' state. You can look around, make experimental
# changes and commit them, and you can discard any commits you make in this
# state without impacting any branches by performing another checkout.
# 
# If you want to create a new branch to retain commits you create, you may
# do so (now or later) by using -b with the checkout command again. Example:
# 
#   git checkout -b <new-branch-name>
# 
# HEAD est maintenant sur 9494c39... Sync with Git 2.8.1
Only the last line is translated.

Blame traces it back to commit 2857093b that was in 2012 so obviously
the lack of translation isn't due to the message being recent.

Thanks,
Rémi

  reply	other threads:[~2016-04-06 20:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  9:25 [PATCH v3][Outreachy] branch -D: allow - as abbreviation of @{-1} Elena Petrashen
2016-03-31 15:09 ` Matthieu Moy
2016-03-31 15:31 ` Remi Galan Alfonso
2016-04-04 20:31   ` elena petrashen
2016-04-04 21:53     ` Remi Galan Alfonso
2016-04-06 10:00       ` elena petrashen
2016-04-06 20:05         ` Remi Galan Alfonso [this message]
2016-03-31 19:26 ` Junio C Hamano
2016-04-06 10:42   ` elena petrashen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=980248197.3116219.1459973119988.JavaMail.zimbra@ensimag.grenoble-inp.fr \
    --to=remi.galan-alfonso@ensimag.grenoble-inp.fr \
    --cc=elena.petrashen@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).