Closed Bug 819534 Opened 12 years ago Closed 7 years ago

l10n should (?) support plurals and placeholders in the same `get`

Categories

(Add-on SDK Graveyard :: General, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: glind, Unassigned)

References

Details

Should this work?  

(oh.my plural is:  'you are afraid of %s -- oh my!')

require("l10n").get("oh.my", 3, 'lions, and tigers, and bears')

I see that it branches in the code between 'plural' and not, but I have no idea of what the expected behaviour of old StringBundles were.
Alex, what do you think?
Flags: needinfo?(poirot.alex)
(Not to bugsit, but pluralization in general is complicated and quite messy!  

Maybe a second function  `getPlural(id,count,...)` makes it less gross?  Having to specify '1' all the time, or being worried that if the 2nd arg is an int, that it will trigger plural handling seems gross too!

Suggestion:  

get -> always 1.
getPlural -> requires count arg

)
That's a reasonable request. I decided for the first version of the localization module for jetpack to 'KISS' and so ignored complex usages of plurals.
But it would be worth to continue the development of localization support for the SDK.
I'm currently considering syncing with l10n effort being done in Gaia (UI for Firefox OS) that embrace HTML localization.
For the story, me and kaze [the webl10n developer] started working together to come up with similar approach. He never stopped tuning his library, whereas I jumped on other tasks...
So it will be matter of pondering the compability cost in order to upgrade with last webl10n version.
Flags: needinfo?(poirot.alex)
OS: Mac OS X → All
Priority: -- → P2
Hardware: x86 → All
Severity: normal → enhancement
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.