{"thread":{"id":"51361","subject":"[PATCH v2] l10n: localizable upload progress messages","startedAt":"2019-06-22T09:28:19Z","lastAt":"2019-06-22T09:28:19Z","messageCount":1,"participants":["Dimitriy Ryazantcev"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"377804","messageId":"20190622092610.79911-2-dimitriy.ryazantcev@gmail.com","threadId":"51361","inReplyTo":null,"subject":"[PATCH v2] l10n: localizable upload progress messages","fromName":"Dimitriy Ryazantcev","fromEmail":"dimitriy.ryazantcev@gmail.com","sentAt":"2019-06-22T09:26:10Z","receivedAt":"2019-06-22T09:28:19Z","isPatch":true,"sender":{"key":"dimitriy.ryazantcev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1285934?v=4"},"body":"Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>\n---\n progress.c |  4 +++-\n strbuf.c   | 16 ++++++++++++----\n 2 files changed, 15 insertions(+), 5 deletions(-)\n\ndiff --git a/progress.c b/progress.c\nindex a2e8cf64a8..61d8cf5d04 100644\n--- a/progress.c\n+++ b/progress.c\n@@ -151,7 +151,9 @@ static void throughput_string(struct strbuf *buf, uint64_t total,\n \tstrbuf_humanise_bytes(buf, total);\n \tstrbuf_addstr(buf, \" | \");\n \tstrbuf_humanise_bytes(buf, rate * 1024);\n-\tstrbuf_addstr(buf, \"/s\");\n+\tstrbuf_addstr(buf, \"/\");\n+\t/* TRANSLATORS: IEC 80000-13:2008, subclause 13-12.b: second */\n+\tstrbuf_addstr(buf, _(\"s\"));\n }\n \n void display_throughput(struct progress *progress, uint64_t total)\ndiff --git a/strbuf.c b/strbuf.c\nindex 0e18b259ce..62144e755c 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -814,20 +814,28 @@ void strbuf_addstr_urlencode(struct strbuf *sb, const char *s,\n void strbuf_humanise_bytes(struct strbuf *buf, off_t bytes)\n {\n \tif (bytes > 1 << 30) {\n-\t\tstrbuf_addf(buf, \"%u.%2.2u GiB\",\n+\t\tstrbuf_addf(buf, \"%u.%2.2u \",\n \t\t\t    (unsigned)(bytes >> 30),\n \t\t\t    (unsigned)(bytes & ((1 << 30) - 1)) / 10737419);\n+\t\t/* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: gibi */\n+\t\tstrbuf_addf(buf, _(\"Gi\"));\n \t} else if (bytes > 1 << 20) {\n \t\tunsigned x = bytes + 5243;  /* for rounding */\n-\t\tstrbuf_addf(buf, \"%u.%2.2u MiB\",\n+\t\tstrbuf_addf(buf, \"%u.%2.2u \",\n \t\t\t    x >> 20, ((x & ((1 << 20) - 1)) * 100) >> 20);\n+\t\t/* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: mebi */\n+\t\tstrbuf_addf(buf, _(\"Mi\"));\n \t} else if (bytes > 1 << 10) {\n \t\tunsigned x = bytes + 5;  /* for rounding */\n-\t\tstrbuf_addf(buf, \"%u.%2.2u KiB\",\n+\t\tstrbuf_addf(buf, \"%u.%2.2u \",\n \t\t\t    x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);\n+\t\t/* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: kibi */\n+\t\tstrbuf_addf(buf, _(\"Ki\"));\n \t} else {\n-\t\tstrbuf_addf(buf, \"%u bytes\", (unsigned)bytes);\n+\t\tstrbuf_addf(buf, \"%u \", (unsigned)bytes);\n \t}\n+\t/* TRANSLATORS: ISO/IEC 80000-13:2008, subclause 13-9.c: byte */\n+\tstrbuf_addf(buf, _(\"B\"));\n }\n \n void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n-- \n2.22.0\n\n"}]}