#135 closed defect (fixed)
plurals value for Serbian triggers an error in poEdit
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | general | Version: | |
| Keywords: | Cc: | nbachiyski |
Description
When a .po file is exported from a Serbian project (e.g. http://translate.wordpress.com/projects/gravatar/sr/default ) and then opened in poEdit, an error is triggered upon save.
18:25:46: /Users/beau/Desktop/grav-trans/sr.po:4: invalid plural expression 18:25:46: /Applications/Poedit.app/Contents/MacOS/msgfmt: found 1 fatal error
The plurals value included in the .po file is:
nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 or n%100>=20) ? 1 : 2);
changing it to this allows you to save the file successfully:
nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
The modified value was taken from this page: http://drupal.org/node/17564
Change History (4)
Tested this. Realized I was off and missed the other, more obvious difference.
- Resolution set to fixed
- Status changed from new to closed
comment:4
nbachiyski — 13 months ago
- Cc nbachiyski added
Note: See
TracTickets for help on using
tickets.

The difference appears to be a set of parentheses around the entire plural expression. I cannot find a spec, but they are omitted from http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html.
Quite a few locales follow this same pattern in locales.php, though it is not consistent. Here are the ones that would need to be updated: