Closed Bug 1055849 Opened 10 years ago Closed 10 years ago

Editor Brands need to use ngettext

Categories

(Marketplace Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: clouserw, Assigned: spasovski)

References

Details

Look in this file: https://github.com/mozilla/fireplace/blob/master/src/media/js/feed.js There are a lot of lines like: > 'book': [gettext('Book'), gettext('Books')], These don't make sense in non-English languages (or, more accurately, languages with different plural forms). In other languages, like Russian, the word Books will change depending on if the number of Books ends in a 1 (1, 51, 61, etc. but NOT 11), or if the last digit is a 2, 3, or 4 (but not 12, 13, or 14), or if it's any other number. These rules are different depending on the language and the .po file has a syntax which supports them, but we need to use ngettext() to trigger it. If we were to use the same list structure as is in the file now, the line would look like this: > 'book': [ngettext('Book', 'Books', 1), ngettext('Book', 'Books', 2)], Which, in English, would return a list of ['Book', 'Books']. As you can see, the 2 is arbitrary here and only works for English. The whole structure of 'key' => ['singular', 'plural'] will only work for English and similar languages. The ngettext() call should be made where it is used so the appropriate string can be shown. Read about ngettext at http://php.net/manual/en/function.ngettext.php
Davor's been on it.
Assignee: nobody → dspasovski
(In reply to Christopher Van Wiemeersch [:cvan] from comment #1) > This was discussed here: > https://github.com/mozilla/fireplace/commit/9d2014de#commitcomment-7380001 Good discussion there. We shouldn't have landed it without that being addressed. Now we're changing .po files which means we might be throwing out work from volunteers.
Blocks: 1055851
Blocks: 1055850
Please add STR here or mark it with [qa-] if no QA is needed.
I've verified this
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.