{"thread":{"id":"31395","subject":"[PATCH] i18n: mark more index-pack strings for translation","startedAt":"2012-08-31T12:13:04Z","lastAt":"2012-08-31T20:02:20Z","messageCount":2,"participants":["Nguyễn Thái Ngọc Duy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"198143","messageId":"1346415184-25685-1-git-send-email-pclouds@gmail.com","threadId":"31395","inReplyTo":null,"subject":"[PATCH] i18n: mark more index-pack strings for translation","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-08-31T12:13:04Z","receivedAt":"2012-08-31T12:13:04Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n The main string I'm after is \"completed with %d local objects\", which\n is part of typical UI. The rest is just \"while at there...\"\n\n To my surprise, (GNU) gettext does seem to know how to deal with\n PRIu32 macro in the middle of the string.\n\n builtin/index-pack.c | 21 +++++++++++----------\n 1 file changed, 11 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 953dd30..43d364b 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -291,7 +291,7 @@ static void parse_pack_header(void)\n \tif (hdr->hdr_signature != htonl(PACK_SIGNATURE))\n \t\tdie(_(\"pack signature mismatch\"));\n \tif (!pack_version_ok(hdr->hdr_version))\n-\t\tdie(\"pack version %\"PRIu32\" unsupported\",\n+\t\tdie(_(\"pack version %\"PRIu32\" unsupported\"),\n \t\t\tntohl(hdr->hdr_version));\n \n \tnr_objects = ntohl(hdr->hdr_entries);\n@@ -1061,7 +1061,8 @@ static void resolve_deltas(void)\n \t\t\tint ret = pthread_create(&thread_data[i].thread, NULL,\n \t\t\t\t\t\t threaded_second_pass, thread_data + i);\n \t\t\tif (ret)\n-\t\t\t\tdie(\"unable to create thread: %s\", strerror(ret));\n+\t\t\t\tdie(_(\"unable to create thread: %s\"),\n+\t\t\t\t    strerror(ret));\n \t\t}\n \t\tfor (i = 0; i < nr_threads; i++)\n \t\t\tpthread_join(thread_data[i].thread, NULL);\n@@ -1108,7 +1109,7 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha\n \t\t\t\t   * sizeof(*objects));\n \t\tf = sha1fd(output_fd, curr_pack);\n \t\tfix_unresolved_deltas(f, nr_unresolved);\n-\t\tsprintf(msg, \"completed with %d local objects\",\n+\t\tsprintf(msg, _(\"completed with %d local objects\"),\n \t\t\tnr_objects - nr_objects_initial);\n \t\tstop_progress_msg(&progress, msg);\n \t\tsha1close(f, tail_sha1, 0);\n@@ -1117,8 +1118,8 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha\n \t\t\t\t\t curr_pack, nr_objects,\n \t\t\t\t\t read_sha1, consumed_bytes-20);\n \t\tif (hashcmp(read_sha1, tail_sha1) != 0)\n-\t\t\tdie(\"Unexpected tail checksum for %s \"\n-\t\t\t    \"(disk corruption?)\", curr_pack);\n+\t\t\tdie(_(\"Unexpected tail checksum for %s \"\n+\t\t\t      \"(disk corruption?)\"), curr_pack);\n \t}\n \tif (nr_deltas != nr_resolved_deltas)\n \t\tdie(Q_(\"pack has %d unresolved delta\",\n@@ -1327,17 +1328,17 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)\n \tif (!strcmp(k, \"pack.indexversion\")) {\n \t\topts->version = git_config_int(k, v);\n \t\tif (opts->version > 2)\n-\t\t\tdie(\"bad pack.indexversion=%\"PRIu32, opts->version);\n+\t\t\tdie(_(\"bad pack.indexversion=%\"PRIu32), opts->version);\n \t\treturn 0;\n \t}\n \tif (!strcmp(k, \"pack.threads\")) {\n \t\tnr_threads = git_config_int(k, v);\n \t\tif (nr_threads < 0)\n-\t\t\tdie(\"invalid number of threads specified (%d)\",\n+\t\t\tdie(_(\"invalid number of threads specified (%d)\"),\n \t\t\t    nr_threads);\n #ifdef NO_PTHREADS\n \t\tif (nr_threads != 1)\n-\t\t\twarning(\"no threads support, ignoring %s\", k);\n+\t\t\twarning(_(\"no threads support, ignoring %s\"), k);\n \t\tnr_threads = 1;\n #endif\n \t\treturn 0;\n@@ -1510,8 +1511,8 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)\n \t\t\t\t\tusage(index_pack_usage);\n #ifdef NO_PTHREADS\n \t\t\t\tif (nr_threads != 1)\n-\t\t\t\t\twarning(\"no threads support, \"\n-\t\t\t\t\t\t\"ignoring %s\", arg);\n+\t\t\t\t\twarning(_(\"no threads support, \"\n+\t\t\t\t\t\t  \"ignoring %s\"), arg);\n \t\t\t\tnr_threads = 1;\n #endif\n \t\t\t} else if (!prefixcmp(arg, \"--pack_header=\")) {\n-- \n1.7.12.rc2.18.g61b472e\n"},{"id":"198168","messageId":"7vfw72n837.fsf@alter.siamese.dyndns.org","threadId":"31395","inReplyTo":"1346415184-25685-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] i18n: mark more index-pack strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-31T20:02:20Z","receivedAt":"2012-08-31T20:02:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  The main string I'm after is \"completed with %d local objects\", which\n>  is part of typical UI. The rest is just \"while at there...\"\n>\n>  To my surprise, (GNU) gettext does seem to know how to deal with\n>  PRIu32 macro in the middle of the string.\n\n;-)\n"}]}