Looks like this already exists in the form of the formatStringForName. However, that only works for strings using the %1,%2 syntax. Strings using #1, etc are formatted using PluralForm.get() (example), like this one. Maybe we should have an extra function under StringBundle or PluralForm that combines these two actions, something like StringBundle.prototype.getPluralFromName = (name,number) -> PluralForm.get(number,this.GetStringFromName(name)) : http://mxr.mozilla.org/mozilla-central/source/browser/base/content/sync/setup.js#897 : http://mxr.mozilla.org/mozilla-central/source/browser/locales/en-US/chrome/browser/syncSetup.properties#24
Another way to do this is to take PluralForm and give it another method `PluralForm.formatPluralStringFromName(number,name,bundle)`. This puts the method in a logically better place, but we have to give it an extra argument. The relevant PluralForm code is here Once this is done we can file a separate bug that uses this function everywhere. (assigning and setting as good first bug as per IRC discusion) : http://dxr.mozilla.org/mozilla-central/source/intl/locale/src/PluralForm.jsm
I don't think I'll have time to work on this anytime soon. It's still a good first bug though.
:manishearth I'd like to try out this bug.
Alright, assigned. We're going to go with making `PluralForm.formatPluralStringFromName(number,name,bundle)`, you can look at the mxr/dxr links above to get an idea of how the two functions are used and how we need to merge them. Let me know (either here or in IRC) if you need help!
Resetting since Ranveer is busy right now and others should have a chance to take this bug. Ranveer, I'll get you a different bug later :)
hey, i would like work on this bug. can you please assign this to me ??
You already have one other bug assigned to you -- start work on this first :)
Hello there! New contributor, would love to work on this bug. Can it please be assigned to me?
(In reply to Yennisaur from comment #9) > Hello there! > New contributor, would love to work on this bug. Can it please be assigned > to me? Sure, have you started work on it yet? Ping me here or on IRC if you would like some help understanding this.
(In reply to Manish Goregaokar [:manishearth] from comment #10) > (In reply to Yennisaur from comment #9) > > Hello there! > > New contributor, would love to work on this bug. Can it please be assigned > > to me? > > Sure, have you started work on it yet? Ping me here or on IRC if you would > like some help understanding this. My current understanding is that a method needs to be developed to combine two functions with multiple variables, the variables would then have different outcomes based on numeric assignment. I've found the code and have seen the bug fixes mentioned earlier in this thread. I have yet to start working, as I am currently reviewing the code in its entirety. Am I on the right track?
Assigning to Yennisaur while working on it as part of the Ascend Project. Yenni is actively working on a patch this week and next.
Tackling a different 'good first bug" - will return to this if it is still available.
Updated links: PluralForm.jsm: https://dxr.mozilla.org/mozilla-central/source/intl/locale/PluralForm.jsm Example from comment 0: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/sync/setup.js#889 Steps remain the same, see comment 2. Feel free to take the alternate route of stringBundle.getPluralStringFromName(...) mentioned in comment 1.
Hi! I am a newbie here. Can I work on this?
Comment on attachment 8702146 [details] [diff] [review] Bug974259.patch Review of attachment 8702146 [details] [diff] [review]: ----------------------------------------------------------------- This does the main change and looks correct, however you also need to make this get used everywhere you can. (in mxr.mozilla.org/mozilla-central/source/browser/base/content/sync/setup.js, as well as any other files you find that use the pattern) ::: intl/locale/PluralForm.jsm @@ +168,5 @@ > GetStringFromName("pluralRule")); > + }, > + > + /** > + * Consolidated function with PluralForm nit: extra whitespace
How do I find all the files where to apply this function?