{"thread":{"id":"51365","subject":"[PATCH v4] l10n: localizable upload progress messages","startedAt":"2019-06-23T09:27:43Z","lastAt":"2019-06-23T09:27:43Z","messageCount":1,"participants":["Dimitriy Ryazantcev"],"isPatch":true,"patchVersion":4,"patchTotal":null},"messages":[{"id":"377822","messageId":"20190623092717.82424-2-dimitriy.ryazantcev@gmail.com","threadId":"51365","inReplyTo":null,"subject":"[PATCH v4] l10n: localizable upload progress messages","fromName":"Dimitriy Ryazantcev","fromEmail":"dimitriy.ryazantcev@gmail.com","sentAt":"2019-06-23T09:27:17Z","receivedAt":"2019-06-23T09:27:43Z","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..fc62941fa4 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: unit symbol for IEC 80000-13:2008 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..706b3b8e42 100644\n--- a/strbuf.c\n+++ b/strbuf.c\n@@ -814,19 +814,27 @@ 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: unit symbol for IEC 80000-13:2008 gibibyte */\n+\t\tstrbuf_addstr(buf, _(\"GiB\"));\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: unit symbol for IEC 80000-13:2008 mebibyte */\n+\t\tstrbuf_addstr(buf, _(\"MiB\"));\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: unit symbol for IEC 80000-13:2008 kibibyte */\n+\t\tstrbuf_addstr(buf, _(\"KiB\"));\n \t} else {\n-\t\tstrbuf_addf(buf, \"%u bytes\", (unsigned)bytes);\n+\t\tstrbuf_addf(buf, \"%u \", (unsigned)bytes);\n+\t\t/* TRANSLATORS: unit symbol for IEC 80000-13:2008 byte */\n+\t\tstrbuf_addstr(buf, _(\"B\"));\n \t}\n }\n \n-- \n2.22.0\n\n"}]}