[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 Eric Gallager changed: What|Removed |Added Blocks||40883 CC||egallager at gcc dot gnu.org Keywords||easyhack Severity|normal |trivial Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40883 [Bug 40883] [meta-bug] Translation breakage with trivial fixes
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 --- Comment #9 from Roland Illig --- Is there already someone who wants to fix the remaining messages? Jakub, you fixed some of them already in https://gcc.gnu.org/viewcvs?rev=258154=gcc=rev in March 2018. There are still some messages that use fmtwarn instead of fmtwarn_n and still contain "%wu bytes" or its close relative "%wu or more bytes". Another even trickier message is "between %wu and %wu bytes". This one uses a range of numbers, and in Arabic the rules for the correct word form are quite numerous: https://www.unicode.org/cldr/charts/33/supplemental/language_plural_rules.html#ar If GCC wants to be the project demonstrating best practices in translation, it should even handle this case correctly. I'm not sure though whether gettext supports this at all. Current state: #c0 is fixed #c1 is fixed in 2 out of 3 cases #c6 is fixed
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 --- Comment #8 from Jakub Jelinek --- Author: jakub Date: Thu Apr 18 10:28:21 2019 New Revision: 270438 URL: https://gcc.gnu.org/viewcvs?rev=270438=gcc=rev Log: PR translation/79183 * gimple-ssa-sprintf.c (format_directive): Use inform_n instead of inform where appropriate. Modified: trunk/gcc/ChangeLog trunk/gcc/c/c-decl.c trunk/gcc/cp/decl.c trunk/gcc/gimple-ssa-sprintf.c
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #7 from Jakub Jelinek --- Created attachment 46188 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46188=edit gcc9-pr79183.patch Untested fix for those two cases.
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 Roland Illig changed: What|Removed |Added CC||roland.illig at gmx dot de --- Comment #6 from Roland Illig --- Also in gimple-ssa-sprintf.c: inform (callloc, (min == 1 ? G_("%qE output %wu byte") : G_("%qE output %wu bytes")), info.func, min); inform (callloc, (min == 1 ? G_("%qE output %wu byte into a destination of size %wu") : G_("%qE output %wu bytes into a destination of size " "%wu")), info.func, min, info.objsize);
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 --- Comment #5 from Martin Sebor --- I see, thanks for the pointer. Looks like warning_n() is used in gcc/ipa-devirt.c and error_n() in gcc/cp/pt.c. gimple-ssa-sprintf.c contains between 7 and 23 instances of these "%wu byte" vs "%wu bytes" forms so it will be a fun exercise to fix.
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 --- Comment #4 from Joseph S. Myers --- See hr.po, ru.po, sr.po and uk.po for GCC translations involving more than just singular and plural (look at the Plural-Forms line in the .po file).
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 Joseph S. Myers changed: What|Removed |Added Status|RESOLVED|NEW Last reconfirmed||2017-02-08 Resolution|INVALID |--- Ever confirmed|0 |1 --- Comment #3 from Joseph S. Myers --- Messages involving plurals need to go through ngettext (via warning_n etc. functions) because some languages have more than just singular and plural forms (e.g. separate forms to use when n = 2 from n > 2).
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||msebor at gcc dot gnu.org Resolution|--- |INVALID --- Comment #2 from Martin Sebor --- I don't see anything wrong with the messages. The plural form is used when the byte count is greater than 1. None of the messages should be issued when the counter is zero because writing no bytes cannot lead to truncation. If you have a test case to the contrary please reopen the bug and provide the test case.
[Bug translation/79183] Hard coded plurals in gimple-ssa-sprintf.c:2050
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79183 --- Comment #1 from Frederic Marchal --- Yet another hard coded plural in the same file at line 2286: inform (callloc, (nbytes + exact == 1 ? G_("format output %wu byte into a destination of size %wu") : G_("format output %wu bytes into a destination of size %wu")), nbytes + exact, info.objsize);