GNU gettext - Bugs: bug #24433, missing Python format specifier is...
You are not allowed to post comments on this tracker with your current authentication level.
bug #24433: missing Python format specifier is not a fatal error
Submitter: | anatoly techtonik <techtonik> | ||
Submitted: | Thu 02 Oct 2008 03:52:29 PM UTC | ||
Category: | Plural forms | Severity: | 3 - Normal |
Item Group: | None | Status: | Fix Released |
Privacy: | Public | Assigned to: | haible |
Open/Closed: | Closed |
Sat 04 Oct 2008 03:00:38 PM UTC, comment #3: |
Bruno Haible <haible> |
Fri 03 Oct 2008 09:00:00 AM UTC, comment #2: # third form ain't used
|
anatoly techtonik <techtonik> |
Fri 03 Oct 2008 12:32:26 AM UTC, comment #1:
|
Bruno Haible <haible> |
Thu 02 Oct 2008 03:52:29 PM UTC, original submission:
Python strings may contain keyword format specifiers like described in gettext manual http://www.gnu.org/software/gettext/manual/gettext.html#Python
|
anatoly techtonik <techtonik> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2023-01-04 | haible | Status | Fixed | Fix Released | |
2016-11-27 | haible | Category | None | Plural forms | |
2008-10-04 | haible | Status | Need Info | Fixed | |
Open/Closed | Open | Closed | |||
2008-10-03 | haible | Status | None | Need Info | |
Assigned to | None | haible | |||
2008-10-02 | techtonik | Attached File | - | Added ru.po, #16601 |
Powered by Savane 3.13-4b48.
Corresponding source code
As a workaround (as a translator), you can use a plural formula
that has 4 plural forms:
n == 1 -> 0
n%10==1 && n%100!=11 -> 1
n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) -> 2
elee -> 3
But for a real fix: I've now added to gettext the support for a
'range:' declaration. The programmer can write
# xgettext: range: 1..3
s = self.ngettext('1 %(number)s/4 hours', '1 %(number)s/4 hours', _quarters)%{'number': _quarters))
This information about the range will make msgfmt understand that
the form applies to a single value of n in this case and that
therefore omitting the %(number) directive is ok.
Will be contained in gettext 0.18.