Hey Greg, Can't say that I am aware of "few" and "many" as values in "quantity". I have only used "one" and "other" so far...
Sorry that I can't be much of a help here. Perhaps developers of the Android platform can shed some light for us? Hello? haha. Makas On Mar 12, 7:57 am, Greg Giacovelli <miyamo...@gmail.com> wrote: > Thanks :) Sadly I just read through tons of source code and got this > Pretty interesting :) Ok so since you seem to know that, would you > know what the quantity="few", quantity="many" do? > > The src code doesn't seem to define them in the PluralRules > implemented, or at least nothing that is really concrete. Is there a > formal definition somewhere? > > -Greg > > On Mar 11, 1:57 pm, Makas Tzavellas <makas.tzavel...@gmail.com> wrote: > > > Hi Greg, > > > To use plurals. You declare it like this in your strings.xml. > > > <plurals name="thing_string"> > > <item quantity="one">%s thing</item> > > <item quantity="other">@s things</item> > > </plurals> > > > Hope this helps. > > > On Mar 11, 10:26 am, Greg <miyamo...@gmail.com> wrote: > > > > Hi, > > > I am used to just using a choice format for doing something deciding > > > between "{0} thing" and "{0} things". > > > > However Context and Resources have a lot of utitilities it seems for > > > dealing with String and loading them with native replacement. One > > > method of such is Resources.getQuantityText(int id, int quantity) ... > > > problem is the way to declare the string is not declared anywhere and > > > upon using this method I am greeted with > > > > android.content.res.Resources$NotFoundException:Pluralresource ID > > > #0x7f080050 quantity=450 item=other > > > > Looking at the source it does use a native method to load the > > > pluralized resource so I can't look at the code. Would anyone know how > > > to use this may-be pretty nifty utility? > > > > I was thinking it might be something like: > > > > <string name="thing_string" pluralrule="one">%1$d thing</string> > > > <string name="thing_string" pluralrule="other">%1$d things</string> > > > > since they don't use the xml id element but I am just guessing and am > > > completely stumped. > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en