Merge branch 'nd/i18n'
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 May 2012 20:51:35 +0000 (13:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 May 2012 20:51:35 +0000 (13:51 -0700)
More message strings marked for i18n.

By Nguyễn Thái Ngọc Duy (10) and Jonathan Nieder (1)
* nd/i18n:
  help: replace underlining "help -a" headers using hyphens with a blank line
  i18n: bundle: mark strings for translation
  i18n: index-pack: mark strings for translation
  i18n: apply: update say_patch_name to give translators complete sentence
  i18n: apply: mark strings for translation
  i18n: remote: mark strings for translation
  i18n: make warn_dangling_symref() automatically append \n
  i18n: help: mark strings for translation
  i18n: mark relative dates for translation
  strbuf: convenience format functions with \n automatically appended
  Makefile: feed all header files to xgettext

1  2 
Makefile
builtin/apply.c
builtin/fetch.c
builtin/remote.c
bundle.c
cache.h
refs.c

diff --cc Makefile
Simple merge
diff --cc builtin/apply.c
index 799bb5e906c1e6de6c95cad4b9f4ee8fedf258f0,c768b7fb028813c114e0d28244307d5453b20a77..725712d7888c1a5503c2249c6dbd50ee796c2851
@@@ -388,11 -349,14 +389,13 @@@ static void say_patch_name(FILE *output
                const char *n = patch->new_name;
                if (!n)
                        n = patch->old_name;
-               quote_c_style(n, NULL, output, 0);
+               quote_c_style(n, &sb, NULL, 0);
        }
-       fputs(post, output);
+       fprintf(output, fmt, sb.buf);
+       fputc('\n', output);
+       strbuf_release(&sb);
  }
  
 -#define CHUNKSIZE (8192)
  #define SLOP (16)
  
  static void read_patch_file(struct strbuf *sb, int fd)
@@@ -1455,10 -1404,13 +1458,14 @@@ static int find_header(const char *line
                                continue;
                        if (!patch->old_name && !patch->new_name) {
                                if (!patch->def_name)
-                                       die("git diff header lacks filename information when removing "
-                                           "%d leading pathname components (line %d)" , p_value, linenr);
+                                       die(Q_("git diff header lacks filename information when removing "
+                                              "%d leading pathname component (line %d)",
+                                              "git diff header lacks filename information when removing "
+                                              "%d leading pathname components (line %d)",
+                                              p_value),
+                                           p_value, linenr);
 -                              patch->old_name = patch->new_name = patch->def_name;
 +                              patch->old_name = xstrdup(patch->def_name);
 +                              patch->new_name = xstrdup(patch->def_name);
                        }
                        if (!patch->is_delete && !patch->new_name)
                                die("git diff header lacks filename information "
@@@ -3024,10 -2943,10 +3035,10 @@@ static int apply_data(struct patch *pat
        if (!(patch->is_copy || patch->is_rename) &&
            (tpatch = in_fn_table(patch->old_name)) != NULL && !to_be_deleted(tpatch)) {
                if (was_deleted(tpatch)) {
-                       return error("patch %s has been renamed/deleted",
+                       return error(_("patch %s has been renamed/deleted"),
                                patch->old_name);
                }
 -              /* We have a patched copy in memory use that */
 +              /* We have a patched copy in memory; use that. */
                strbuf_add(&buf, tpatch->result, tpatch->resultsize);
        } else if (cached) {
                if (read_file_or_gitlink(ce, &buf))
diff --cc builtin/fetch.c
Simple merge
Simple merge
diff --cc bundle.c
index 27ab32e431660a217d5dce50fe5b5b91888b5908,6d21c77421767161d26a86f744d71b5752e1be76..8d31b98f58b9e9bf156615130ec80684f788fcaa
+++ b/bundle.c
@@@ -289,7 -293,7 +293,7 @@@ int create_bundle(struct bundle_header 
        argc = setup_revisions(argc, argv, &revs, NULL);
  
        if (argc > 1)
-               return error("unrecognized argument: %s", argv[1]);
 -              return error(_("unrecognized argument: %s'"), argv[1]);
++              return error(_("unrecognized argument: %s"), argv[1]);
  
        object_array_remove_duplicates(&revs.pending);
  
diff --cc cache.h
Simple merge
diff --cc refs.c
index 09322fede0841e7954e3e4cb7d3d0b1f673555d7,052c2f6058a3bbf97eeff236b288bf36afe36c7f..a5802e19029747fc95939bc9110ea151c080c30c
--- 1/refs.c
--- 2/refs.c
+++ b/refs.c
@@@ -1105,40 -715,6 +1105,41 @@@ fallback
        return -1;
  }
  
 +struct warn_if_dangling_data {
 +      FILE *fp;
 +      const char *refname;
 +      const char *msg_fmt;
 +};
 +
 +static int warn_if_dangling_symref(const char *refname, const unsigned char *sha1,
 +                                 int flags, void *cb_data)
 +{
 +      struct warn_if_dangling_data *d = cb_data;
 +      const char *resolves_to;
 +      unsigned char junk[20];
 +
 +      if (!(flags & REF_ISSYMREF))
 +              return 0;
 +
 +      resolves_to = resolve_ref_unsafe(refname, junk, 0, NULL);
 +      if (!resolves_to || strcmp(resolves_to, d->refname))
 +              return 0;
 +
 +      fprintf(d->fp, d->msg_fmt, refname);
++      fputc('\n', d->fp);
 +      return 0;
 +}
 +
 +void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)
 +{
 +      struct warn_if_dangling_data data;
 +
 +      data.fp = fp;
 +      data.refname = refname;
 +      data.msg_fmt = msg_fmt;
 +      for_each_rawref(warn_if_dangling_symref, &data);
 +}
 +
  static int do_for_each_ref(const char *submodule, const char *base, each_ref_fn fn,
                           int trim, int flags, void *cb_data)
  {