bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/28072] New: Hard coded plural in readelf.c


From: fmarchal at perso dot be
Subject: [Bug binutils/28072] New: Hard coded plural in readelf.c
Date: Sat, 10 Jul 2021 15:33:46 +0000

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

            Bug ID: 28072
           Summary: Hard coded plural in readelf.c
           Product: binutils
           Version: 2.38 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: fmarchal at perso dot be
  Target Milestone: ---

Readelf.c at line 10946 contains a rule to display a message with
singular/plural.

The rule is hard coded. It assumes 1 is singular and everything else is plural.
This is valid for English but not for other languages. That construct can't be
translated accurately.

````
  if (do_dynamic && filedata->dynamic_addr)
    {
      if (filedata->dynamic_nent == 1)
        {
          if (filedata->is_separate)
            printf (_("\nIn linked file '%s' the dynamic section at offset
0x%lx contains 1 entry:\n"),
                    filedata->file_name,
                    filedata->dynamic_addr);
          else
            printf (_("\nDynamic section at offset 0x%lx contains 1 entry:\n"),
                    filedata->dynamic_addr);
        }
      else
        {
          if (filedata->is_separate)
            printf (_("\nIn linked file '%s' the dynamic section at offset
0x%lx contains %lu entries:\n"),
                    filedata->file_name,
                    filedata->dynamic_addr,
                    (unsigned long) filedata->dynamic_nent);
          else
            printf (_("\nDynamic section at offset 0x%lx contains %lu
entries:\n"),
                    filedata->dynamic_addr,
                    (unsigned long) filedata->dynamic_nent);
        }
    }
````

See gettext documentation for more information about the issue with plural:
https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]