{"thread":{"id":"51362","subject":"[PATCH v3] l10n: localizable upload progress messages","startedAt":"2019-06-22T09:37:41Z","lastAt":"2019-06-24T18:04:44Z","messageCount":10,"participants":["Dimitriy Ryazantcev","Duy Nguyen","Dimitriy","Johannes Sixt","brian m. carlson","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"377805","messageId":"20190622093655.80092-2-dimitriy.ryazantcev@gmail.com","threadId":"51362","inReplyTo":null,"subject":"[PATCH v3] l10n: localizable upload progress messages","fromName":"Dimitriy Ryazantcev","fromEmail":"dimitriy.ryazantcev@gmail.com","sentAt":"2019-06-22T09:36:55Z","receivedAt":"2019-06-22T09:37:41Z","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..0a3ebc3749 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_addstr(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_addstr(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_addstr(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_addstr(buf, _(\"B\"));\n }\n \n void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n-- \n2.22.0\n\n"},{"id":"377813","messageId":"CACsJy8CPChOGSZVfXd6ioaXHWg_aFxNMzr2J=Zdm2RZXkO++Ew@mail.gmail.com","threadId":"51362","inReplyTo":"20190622093655.80092-2-dimitriy.ryazantcev@gmail.com","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-06-22T11:42:14Z","receivedAt":"2019-06-22T11:42:53Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Jun 22, 2019 at 4:37 PM Dimitriy Ryazantcev\n<dimitriy.ryazantcev@gmail.com> wrote:\n> diff --git a/strbuf.c b/strbuf.c\n> index 0e18b259ce..0a3ebc3749 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>         if (bytes > 1 << 30) {\n> -               strbuf_addf(buf, \"%u.%2.2u GiB\",\n> +               strbuf_addf(buf, \"%u.%2.2u \",\n>                             (unsigned)(bytes >> 30),\n>                             (unsigned)(bytes & ((1 << 30) - 1)) / 10737419);\n> +               /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: gibi */\n> +               strbuf_addstr(buf, _(\"Gi\"));\n\nIt may be ISO standard, but GiB to me looks much easier to understand.\nWhat's the reason for changing GiB to Gi btw?\n\n>         } else if (bytes > 1 << 20) {\n>                 unsigned x = bytes + 5243;  /* for rounding */\n> -               strbuf_addf(buf, \"%u.%2.2u MiB\",\n> +               strbuf_addf(buf, \"%u.%2.2u \",\n>                             x >> 20, ((x & ((1 << 20) - 1)) * 100) >> 20);\n> +               /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: mebi */\n> +               strbuf_addstr(buf, _(\"Mi\"));\n>         } else if (bytes > 1 << 10) {\n>                 unsigned x = bytes + 5;  /* for rounding */\n> -               strbuf_addf(buf, \"%u.%2.2u KiB\",\n> +               strbuf_addf(buf, \"%u.%2.2u \",\n>                             x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);\n> +               /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: kibi */\n> +               strbuf_addstr(buf, _(\"Ki\"));\n>         } else {\n> -               strbuf_addf(buf, \"%u bytes\", (unsigned)bytes);\n> +               strbuf_addf(buf, \"%u \", (unsigned)bytes);\n>         }\n> +       /* TRANSLATORS: ISO/IEC 80000-13:2008, subclause 13-9.c: byte */\n> +       strbuf_addstr(buf, _(\"B\"));\n>  }\n>\n>  void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n> --\n> 2.22.0\n>\n\n\n-- \nDuy\n"},{"id":"377816","messageId":"CAPUT4mQnsThA=ZxZD8K+J+u6tbN5PggPomuymEUO=u2GT88aUA@mail.gmail.com","threadId":"51362","inReplyTo":"CACsJy8CPChOGSZVfXd6ioaXHWg_aFxNMzr2J=Zdm2RZXkO++Ew@mail.gmail.com","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Dimitriy","fromEmail":"dimitriy.ryazantcev@gmail.com","sentAt":"2019-06-22T16:39:57Z","receivedAt":"2019-06-22T16:40:11Z","isPatch":true,"sender":{"key":"dimitriy.ryazantcev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1285934?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> wrote:\n>\n> On Sat, Jun 22, 2019 at 4:37 PM Dimitriy Ryazantcev\n> <dimitriy.ryazantcev@gmail.com> wrote:\n> > diff --git a/strbuf.c b/strbuf.c\n> > index 0e18b259ce..0a3ebc3749 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> >         if (bytes > 1 << 30) {\n> > -               strbuf_addf(buf, \"%u.%2.2u GiB\",\n> > +               strbuf_addf(buf, \"%u.%2.2u \",\n> >                             (unsigned)(bytes >> 30),\n> >                             (unsigned)(bytes & ((1 << 30) - 1)) / 10737419);\n> > +               /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: gibi */\n> > +               strbuf_addstr(buf, _(\"Gi\"));\n>\n> It may be ISO standard, but GiB to me looks much easier to understand.\n> What's the reason for changing GiB to Gi btw?\n\nI just moved 'B' out of else block so it will be prepended with\n'Gi'/'Mi'/'Ki' when needed.\nNote: I changed 'bytes' to just 'B' unit.\n\n>\n> >         } else if (bytes > 1 << 20) {\n> >                 unsigned x = bytes + 5243;  /* for rounding */\n> > -               strbuf_addf(buf, \"%u.%2.2u MiB\",\n> > +               strbuf_addf(buf, \"%u.%2.2u \",\n> >                             x >> 20, ((x & ((1 << 20) - 1)) * 100) >> 20);\n> > +               /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: mebi */\n> > +               strbuf_addstr(buf, _(\"Mi\"));\n> >         } else if (bytes > 1 << 10) {\n> >                 unsigned x = bytes + 5;  /* for rounding */\n> > -               strbuf_addf(buf, \"%u.%2.2u KiB\",\n> > +               strbuf_addf(buf, \"%u.%2.2u \",\n> >                             x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);\n> > +               /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: kibi */\n> > +               strbuf_addstr(buf, _(\"Ki\"));\n> >         } else {\n> > -               strbuf_addf(buf, \"%u bytes\", (unsigned)bytes);\n> > +               strbuf_addf(buf, \"%u \", (unsigned)bytes);\n> >         }\n> > +       /* TRANSLATORS: ISO/IEC 80000-13:2008, subclause 13-9.c: byte */\n> > +       strbuf_addstr(buf, _(\"B\"));\n> >  }\n> >\n> >  void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n> > --\n> > 2.22.0\n> >\n>\n>\n> --\n> Duy\n\n\n\n-- \nSincerely,\nDimitriy Ryazantcev\n"},{"id":"377819","messageId":"65cf1cfd-bb5f-dba0-17d6-7fee0ed1f51f@kdbg.org","threadId":"51362","inReplyTo":"20190622093655.80092-2-dimitriy.ryazantcev@gmail.com","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2019-06-22T21:42:33Z","receivedAt":"2019-06-22T21:42:49Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 22.06.19 um 11:36 schrieb Dimitriy Ryazantcev:\n> 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> \n> diff --git a/progress.c b/progress.c\n> index 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)\n> diff --git a/strbuf.c b/strbuf.c\n> index 0e18b259ce..0a3ebc3749 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_addstr(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_addstr(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_addstr(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_addstr(buf, _(\"B\"));\n>  }\n>  \n>  void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n> \n\nAll of the prefixes are in ISO/IEC, i.e., standardized. Why do they have\nto be translated?\n\nIsn't the way of presentation of magnitudes with a unit also\nstandardized, and should not need to be translated?\n\n-- Hannes\n"},{"id":"377820","messageId":"20190623010311.GC965782@genre.crustytoothpaste.net","threadId":"51362","inReplyTo":"65cf1cfd-bb5f-dba0-17d6-7fee0ed1f51f@kdbg.org","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-06-23T01:03:12Z","receivedAt":"2019-06-23T01:03:22Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-06-22 at 21:42:33, Johannes Sixt wrote:\n> Am 22.06.19 um 11:36 schrieb Dimitriy Ryazantcev:\n> > diff --git a/strbuf.c b/strbuf.c\n> > index 0e18b259ce..0a3ebc3749 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_addstr(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_addstr(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_addstr(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_addstr(buf, _(\"B\"));\n> >  }\n> >  \n> >  void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n> > \n> \n> All of the prefixes are in ISO/IEC, i.e., standardized. Why do they have\n> to be translated?\n> \n> Isn't the way of presentation of magnitudes with a unit also\n> standardized, and should not need to be translated?\n\nIn my view, the translation is less important for the prefixes and more\nimportant for the unit: at least French prefers the term \"octet\" over\n\"byte\"[0], so instead of writing \"MB\", you'd write \"Mo\".\n\nIn general, I think it's better to keep the prefixes and units together,\nsince trying to translate a single letter runs the risk of collisions\nwith other places in the code. It's likely to be easier for translators\nas well.\n\n[0] Technically, as in English, they have different meanings, but I've\nalways seen French units written with \"o\" for \"octet\", not \"B\" for\n\"byte\".\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"377821","messageId":"CAPUT4mSHK8bD-TGf9QOM2O2ChxTvwScCvmmQH37pedGDVR2w-g@mail.gmail.com","threadId":"51362","inReplyTo":"20190623010311.GC965782@genre.crustytoothpaste.net","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Dimitriy","fromEmail":"dimitriy.ryazantcev@gmail.com","sentAt":"2019-06-23T08:28:41Z","receivedAt":"2019-06-23T08:28:55Z","isPatch":true,"sender":{"key":"dimitriy.ryazantcev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1285934?v=4"},"body":"brian m. carlson <sandals@crustytoothpaste.net> wrote:\n>\n> On 2019-06-22 at 21:42:33, Johannes Sixt wrote:\n> > Am 22.06.19 um 11:36 schrieb Dimitriy Ryazantcev:\n> > > diff --git a/strbuf.c b/strbuf.c\n> > > index 0e18b259ce..0a3ebc3749 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> > >     if (bytes > 1 << 30) {\n> > > -           strbuf_addf(buf, \"%u.%2.2u GiB\",\n> > > +           strbuf_addf(buf, \"%u.%2.2u \",\n> > >                         (unsigned)(bytes >> 30),\n> > >                         (unsigned)(bytes & ((1 << 30) - 1)) / 10737419);\n> > > +           /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: gibi */\n> > > +           strbuf_addstr(buf, _(\"Gi\"));\n> > >     } else if (bytes > 1 << 20) {\n> > >             unsigned x = bytes + 5243;  /* for rounding */\n> > > -           strbuf_addf(buf, \"%u.%2.2u MiB\",\n> > > +           strbuf_addf(buf, \"%u.%2.2u \",\n> > >                         x >> 20, ((x & ((1 << 20) - 1)) * 100) >> 20);\n> > > +           /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: mebi */\n> > > +           strbuf_addstr(buf, _(\"Mi\"));\n> > >     } else if (bytes > 1 << 10) {\n> > >             unsigned x = bytes + 5;  /* for rounding */\n> > > -           strbuf_addf(buf, \"%u.%2.2u KiB\",\n> > > +           strbuf_addf(buf, \"%u.%2.2u \",\n> > >                         x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);\n> > > +           /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: kibi */\n> > > +           strbuf_addstr(buf, _(\"Ki\"));\n> > >     } else {\n> > > -           strbuf_addf(buf, \"%u bytes\", (unsigned)bytes);\n> > > +           strbuf_addf(buf, \"%u \", (unsigned)bytes);\n> > >     }\n> > > +   /* TRANSLATORS: ISO/IEC 80000-13:2008, subclause 13-9.c: byte */\n> > > +   strbuf_addstr(buf, _(\"B\"));\n> > >  }\n> > >\n> > >  void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n> > >\n> >\n> > All of the prefixes are in ISO/IEC, i.e., standardized. Why do they have\n> > to be translated?\n> >\n> > Isn't the way of presentation of magnitudes with a unit also\n> > standardized, and should not need to be translated?\n>\n> In my view, the translation is less important for the prefixes and more\n> important for the unit: at least French prefers the term \"octet\" over\n> \"byte\"[0], so instead of writing \"MB\", you'd write \"Mo\".\n\nLocalization according to local rules is important for every unit part.\nThere is a Russian adoption of IEC 80000-13:2008 called\nGOST R IEC 80000-13-2016[0].\nAnd in this document there is national translations for these units\\prefixes.\nSo 'KiB' should become 'КиБ' according to this national standard.\nSame story with Ukrainian adoption called DSTU IEC 80000-13:2016[1]:\n'KiB' -> 'КіБ'.\nAlso according to ISO website seems that there is French version of\nIEC 80000-13:2008 exist. Not sure about French translation through.\n\n> In general, I think it's better to keep the prefixes and units together,\n> since trying to translate a single letter runs the risk of collisions\n> with other places in the code. It's likely to be easier for translators\n> as well.\n\nI agree with you in this part.\nI searched for similar code in other codebases and found such in KDE\ncodebase[2]. I'll update patch if there is no objections.\n\n> [0] Technically, as in English, they have different meanings, but I've\n> always seen French units written with \"o\" for \"octet\", not \"B\" for\n> \"byte\".\n\nTo solve this ambiguity IEC standard in subclause 13-9.с says\nthat 'byte' implies 'octet' (8-bit byte).\n\n> --\n> brian m. carlson: Houston, Texas, US\n> OpenPGP: https://keybase.io/bk2204\n\n[0] http://docs.cntd.ru/document/1200143231\n[1] http://online.budstandart.com/ua/catalog/doc-page.html?id_doc=69033\n[1] https://cgit.kde.org/kcoreaddons.git/tree/src/lib/util/kformatprivate.cpp#n254\n\n-- \nSincerely,\nDimitriy Ryazantcev\n"},{"id":"377824","messageId":"2074c719-a077-35c4-f30b-769580e17879@kdbg.org","threadId":"51362","inReplyTo":"CAPUT4mSHK8bD-TGf9QOM2O2ChxTvwScCvmmQH37pedGDVR2w-g@mail.gmail.com","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2019-06-23T13:10:56Z","receivedAt":"2019-06-23T13:11:07Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 23.06.19 um 10:28 schrieb Dimitriy:\n> brian m. carlson <sandals@crustytoothpaste.net> wrote:\n>>\n>> On 2019-06-22 at 21:42:33, Johannes Sixt wrote:\n>>> Am 22.06.19 um 11:36 schrieb Dimitriy Ryazantcev:\n>>>> diff --git a/strbuf.c b/strbuf.c\n>>>> index 0e18b259ce..0a3ebc3749 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>>>>     if (bytes > 1 << 30) {\n>>>> -           strbuf_addf(buf, \"%u.%2.2u GiB\",\n>>>> +           strbuf_addf(buf, \"%u.%2.2u \",\n>>>>                         (unsigned)(bytes >> 30),\n>>>>                         (unsigned)(bytes & ((1 << 30) - 1)) / 10737419);\n>>>> +           /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: gibi */\n>>>> +           strbuf_addstr(buf, _(\"Gi\"));\n>>>>     } else if (bytes > 1 << 20) {\n>>>>             unsigned x = bytes + 5243;  /* for rounding */\n>>>> -           strbuf_addf(buf, \"%u.%2.2u MiB\",\n>>>> +           strbuf_addf(buf, \"%u.%2.2u \",\n>>>>                         x >> 20, ((x & ((1 << 20) - 1)) * 100) >> 20);\n>>>> +           /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: mebi */\n>>>> +           strbuf_addstr(buf, _(\"Mi\"));\n>>>>     } else if (bytes > 1 << 10) {\n>>>>             unsigned x = bytes + 5;  /* for rounding */\n>>>> -           strbuf_addf(buf, \"%u.%2.2u KiB\",\n>>>> +           strbuf_addf(buf, \"%u.%2.2u \",\n>>>>                         x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);\n>>>> +           /* TRANSLATORS: ISO/IEC 80000-13:2008, clause 4: kibi */\n>>>> +           strbuf_addstr(buf, _(\"Ki\"));\n>>>>     } else {\n>>>> -           strbuf_addf(buf, \"%u bytes\", (unsigned)bytes);\n>>>> +           strbuf_addf(buf, \"%u \", (unsigned)bytes);\n>>>>     }\n>>>> +   /* TRANSLATORS: ISO/IEC 80000-13:2008, subclause 13-9.c: byte */\n>>>> +   strbuf_addstr(buf, _(\"B\"));\n>>>>  }\n>>>>\n>>>>  void strbuf_add_absolute_path(struct strbuf *sb, const char *path)\n>>>>\n>>>\n>>> All of the prefixes are in ISO/IEC, i.e., standardized. Why do they have\n>>> to be translated?\n>>>\n>>> Isn't the way of presentation of magnitudes with a unit also\n>>> standardized, and should not need to be translated?\n>>\n>> In my view, the translation is less important for the prefixes and more\n>> important for the unit: at least French prefers the term \"octet\" over\n>> \"byte\"[0], so instead of writing \"MB\", you'd write \"Mo\".\n> \n> Localization according to local rules is important for every unit part.\n> There is a Russian adoption of IEC 80000-13:2008 called\n> GOST R IEC 80000-13-2016[0].\n> And in this document there is national translations for these units\\prefixes.\n> So 'KiB' should become 'КиБ' according to this national standard.\n> Same story with Ukrainian adoption called DSTU IEC 80000-13:2016[1]:\n> 'KiB' -> 'КіБ'.\n> Also according to ISO website seems that there is French version of\n> IEC 80000-13:2008 exist. Not sure about French translation through.\n\nThanks for educating me. Given your explanations, wouldn't it be much\nmore natural to keep the prefix with the unit instead of separating\nthem, as the patch does?\n\n-- Hannes\n"},{"id":"377828","messageId":"20190623165835.GD965782@genre.crustytoothpaste.net","threadId":"51362","inReplyTo":"CAPUT4mSHK8bD-TGf9QOM2O2ChxTvwScCvmmQH37pedGDVR2w-g@mail.gmail.com","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-06-23T16:58:35Z","receivedAt":"2019-06-23T16:58:45Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-06-23 at 08:28:41, Dimitriy wrote:\n> brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> > In my view, the translation is less important for the prefixes and more\n> > important for the unit: at least French prefers the term \"octet\" over\n> > \"byte\"[0], so instead of writing \"MB\", you'd write \"Mo\".\n> \n> Localization according to local rules is important for every unit part.\n> There is a Russian adoption of IEC 80000-13:2008 called\n> GOST R IEC 80000-13-2016[0].\n> And in this document there is national translations for these units\\prefixes.\n> So 'KiB' should become 'КиБ' according to this national standard.\n> Same story with Ukrainian adoption called DSTU IEC 80000-13:2016[1]:\n> 'KiB' -> 'КіБ'.\n> Also according to ISO website seems that there is French version of\n> IEC 80000-13:2008 exist. Not sure about French translation through.\n\nI figured the impetus for this change was something like this.\n\n> > In general, I think it's better to keep the prefixes and units together,\n> > since trying to translate a single letter runs the risk of collisions\n> > with other places in the code. It's likely to be easier for translators\n> > as well.\n> \n> I agree with you in this part.\n> I searched for similar code in other codebases and found such in KDE\n> codebase[2]. I'll update patch if there is no objections.\n\nYeah, that sounds good. It's probably sufficient in this case to simply\nmark the existing format strings for translation, since we know\ntranslators can already handle other format strings we have. Also,\nperhaps translators will want to switch the period for a comma, as is\ncommon in some languages.\n\n> > [0] Technically, as in English, they have different meanings, but I've\n> > always seen French units written with \"o\" for \"octet\", not \"B\" for\n> > \"byte\".\n> \n> To solve this ambiguity IEC standard in subclause 13-9.с says\n> that 'byte' implies 'octet' (8-bit byte).\n\nFrench Wikipedia also tells me that \"B\" is the symbol for the bel, so\n\"o\" is preferable because it doesn't conflict. I have no strong opinions\neither way.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"377908","messageId":"xmqq1rzij20h.fsf@gitster-ct.c.googlers.com","threadId":"51362","inReplyTo":"CAPUT4mQnsThA=ZxZD8K+J+u6tbN5PggPomuymEUO=u2GT88aUA@mail.gmail.com","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-06-24T18:01:50Z","receivedAt":"2019-06-24T18:01:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dimitriy <dimitriy.ryazantcev@gmail.com> writes:\n\n> I just moved 'B' out of else block so it will be prepended with\n> 'Gi'/'Mi'/'Ki' when needed.\n> Note: I changed 'bytes' to just 'B' unit.\n\nThat makes this change more than \"localizable messages\", doesn't it?\n\nAs an old timer, I do not mind MiB (I'd prefer the old-fashioned MB\nmyself), but I think \"20 bytes\" (or \"1 byte\") spelled out is much\neasier to grok and less prone to get misunderstood than \"20B\".  Like\nit or not, with scale prefixes, e.g. \"20 kiB\", \"20 MiB\", etc., it is\nhard to misunderstand what 'B' means in there, but without any scale\nprefix, i.e. \"20 B\", it is rather easy to get confused what 'B'\nmeans.\n"},{"id":"377909","messageId":"xmqqwohahnbf.fsf@gitster-ct.c.googlers.com","threadId":"51362","inReplyTo":"2074c719-a077-35c4-f30b-769580e17879@kdbg.org","subject":"Re: [PATCH v3] l10n: localizable upload progress messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-06-24T18:04:36Z","receivedAt":"2019-06-24T18:04:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Thanks for educating me. Given your explanations, wouldn't it be much\n> more natural to keep the prefix with the unit instead of separating\n> them, as the patch does?\n\nYup, that \"octet\" comment was illuminating.  Great discussion.\n\nAlso I am with Duy's message in the other subthread.  We should keep\nthe number placeholder \"%[udf]\" and the unit in a single string),\ninstead of hardcoding the \"a number must come and then unit\" in the\ncode.\n\nThanks.\n"}]}