git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Subject: [RFC PATCH 0/5] Localise error headers
Date: Mon,  2 Jan 2017 12:14:49 +0100	[thread overview]
Message-ID: <cover.1483354746.git.git@drmicha.warpmail.net> (raw)

Currently, the headers "error: ", "warning: " etc. - generated by die(),
warning() etc. - are not localized, but we feed many localized error messages
into these functions so that we produce error messages with mixed localisation.

This series introduces variants of die() etc. that use localised variants of
the headers, i.e. _("error: ") etc., and are to be fed localized messages. So,
instead of die(_("not workee")), which would produce a mixed localisation (such
as "error: geht ned"), one should use die_(_("not workee")) (resulting in
"Fehler: geht ned").

In this implementation, the gettext call for the header and the body are done
in different places (error function vs. caller) but this call pattern seems to
be the easiest variant for the caller, because the message body has to be marked
for localisation in any case, and N_() requires more letters than _(), an extra
argument to die() etc. even more than the extra "_" in the function name.

1/5 prepares the error machinery
2/5 provides new variants error_() etc.
3/5 has coccinelli rules error(_(E)) -> error_(_(E)) etc.
4/5 applies the coccinelli patches

5/5 is not to be applied to the main tree, but helps you try out the feature:
it has changes to de.po and git.pot so that e.g. "git branch" has fully localised
error messages (see the recipe in the commit message).

Michael J Gruber (5):
  error/warn framework: prepare for l10n
  error/warn framework: provide localized variants
  error/warn framework framework: coccinelli rules
  error/warn framework: localize
  WIP: Feature demonstration

 advice.c                           |   16 +-
 apply.c                            |   10 +-
 apply.h                            |    4 +-
 archive.c                          |    6 +-
 attr.c                             |    3 +-
 bisect.c                           |    2 +-
 branch.c                           |    4 +-
 builtin/add.c                      |   20 +-
 builtin/am.c                       |   27 +-
 builtin/archive.c                  |   10 +-
 builtin/blame.c                    |   12 +-
 builtin/branch.c                   |   45 +-
 builtin/bundle.c                   |    4 +-
 builtin/check-ignore.c             |   14 +-
 builtin/check-mailmap.c            |    2 +-
 builtin/checkout-index.c           |    2 +-
 builtin/checkout.c                 |   27 +-
 builtin/clean.c                    |   10 +-
 builtin/clone.c                    |   39 +-
 builtin/column.c                   |    2 +-
 builtin/commit.c                   |   87 +-
 builtin/config.c                   |    2 +-
 builtin/describe.c                 |    6 +-
 builtin/diff.c                     |    2 +-
 builtin/fetch.c                    |   21 +-
 builtin/gc.c                       |    3 +-
 builtin/grep.c                     |   14 +-
 builtin/help.c                     |    4 +-
 builtin/index-pack.c               |   42 +-
 builtin/interpret-trailers.c       |    2 +-
 builtin/log.c                      |   48 +-
 builtin/merge-recursive.c          |    2 +-
 builtin/merge.c                    |   53 +-
 builtin/mv.c                       |    6 +-
 builtin/notes.c                    |   40 +-
 builtin/pack-objects.c             |    4 +-
 builtin/prune.c                    |    2 +-
 builtin/pull.c                     |   10 +-
 builtin/push.c                     |   22 +-
 builtin/remote.c                   |   10 +-
 builtin/repack.c                   |    4 +-
 builtin/replace.c                  |    2 +-
 builtin/reset.c                    |   10 +-
 builtin/rev-list.c                 |    2 +-
 builtin/rev-parse.c                |    2 +-
 builtin/revert.c                   |    4 +-
 builtin/rm.c                       |    6 +-
 builtin/shortlog.c                 |    2 +-
 builtin/show-branch.c              |    7 +-
 builtin/submodule--helper.c        |    9 +-
 builtin/tag.c                      |   20 +-
 builtin/unpack-objects.c           |    2 +-
 builtin/update-index.c             |    8 +-
 builtin/worktree.c                 |    6 +-
 bundle.c                           |    4 +-
 config.c                           |    4 +-
 connect.c                          |    6 +-
 connected.c                        |    2 +-
 contrib/coccinelle/errorl10n.cocci |   47 +
 daemon.c                           |    3 +-
 diff.c                             |    8 +-
 dir.c                              |    4 +-
 fast-import.c                      |    4 +-
 fetch-pack.c                       |   26 +-
 git-compat-util.h                  |   18 +-
 help.c                             |    2 +-
 http-backend.c                     |    4 +-
 http.c                             |    4 +-
 merge.c                            |    2 +-
 notes-utils.c                      |    2 +-
 pathspec.c                         |   13 +-
 po/de.po                           | 2922 ++++++++++++++++++++++++------------
 po/git.pot                         | 2781 ++++++++++++++++++++++------------
 pretty.c                           |    2 +-
 ref-filter.c                       |   20 +-
 remote.c                           |    2 +-
 revision.c                         |    4 +-
 run-command.c                      |    6 +-
 send-pack.c                        |   12 +-
 sequencer.c                        |    7 +-
 setup.c                            |    6 +-
 sha1_file.c                        |    2 +-
 submodule.c                        |    8 +-
 trailer.c                          |    4 +-
 transport.c                        |    2 +-
 tree-walk.c                        |    2 +-
 usage.c                            |  122 +-
 wrapper.c                          |    2 +-
 wt-status.c                        |    2 +-
 89 files changed, 4408 insertions(+), 2374 deletions(-)
 create mode 100644 contrib/coccinelle/errorl10n.cocci

-- 
2.11.0.372.g2fcea0e476


             reply	other threads:[~2017-01-02 11:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 11:14 Michael J Gruber [this message]
2017-01-02 11:14 ` [RFC PATCH 1/5] error/warning framework: prepare for l10n Michael J Gruber
2017-01-02 11:14 ` [RFC PATCH 2/5] error/warn framework: provide localized variants Michael J Gruber
2017-01-02 11:14 ` [RFC PATCH 3/5] error/warning framework framework: coccinelli rules Michael J Gruber
2017-01-03 12:26 ` [RFC PATCH 0/5] Localise error headers Duy Nguyen
2017-01-03 19:45 ` Stefan Beller
2017-01-04 13:25   ` Duy Nguyen
2017-01-07  9:34     ` Duy Nguyen
2017-01-04  7:05 ` Jeff King
2017-01-09 12:43   ` Michael J Gruber
2017-01-10  9:04     ` Jeff King
2017-01-10 18:28       ` Stefan Beller
2017-01-11 11:37         ` Jeff King
2017-01-11 17:15           ` Stefan Beller
2017-01-21 14:24             ` Jeff King
2017-01-11 18:08           ` Junio C Hamano
2017-01-20 13:08             ` Duy Nguyen
2017-01-21 14:19               ` Jeff King
2017-01-21 14:20             ` Jeff King
2017-03-30 15:18               ` Michael J Gruber
2017-04-01  8:12                 ` Jeff King
2017-04-01 17:38                   ` Junio C Hamano
2017-01-20 13:23           ` Duy Nguyen
2017-01-20 13:31             ` Duy Nguyen

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

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

  git send-email \
    --in-reply-to=cover.1483354746.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --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.
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 NNTP newsgroup(s).