https://sourceware.org/bugzilla/show_bug.cgi?id=32002

            Bug ID: 32002
           Summary: Untranslated plural in readelf.c:9433
           Product: binutils
           Version: 2.42
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: fmarchal at perso dot be
  Target Milestone: ---

In readelf.c, line 9431 looks like a hard coded plural:

      if (num_rela == 1)
        /* This is unlikely, but possible.  */
        printf (_(" at offset %#" PRIx64
                  " contains 1 entry which relocates 1 location:\n"),
                rel_offset);
      else
        printf (_(" at offset %#" PRIx64 " contains %" PRIu64
                  " entries which relocate %" PRIu64 " locations:\n"),
                rel_offset, num_rela, count_relr_relocations (filedata,
section));

As explained in
https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html gettext
offers the function ngettext to handle plural in a way that's compatible with
other languages beside English.

As the string contains two distinct plural counts, building such a sentence is
rather clumsy, unfortunately. It might look like this (beware: not actually
tested!):

uint64_t num_reloc = count_relr_relocations (filedata, section);
printf (_(" at offset %#" PRIx64), rel_offset);
printf (ngettext(" contains %" PRIu64" entry which relocates", " contains %"
PRIu64" entries which relocate", num_rela), num_rela), 
printf (ngettext(" %" PRIu64 " location:\n", " %" PRIu64 " locations:\n",
num_reloc), num_reloc)

This is still not as easy to translate as usual self contained sentences but
it's the only way I could find.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to