Questions tagged [plural]

Pertaining to handling text that must change depending on the number of items involved, according to the rules of different languages.

Pertaining to handling text that must change depending on the number of items involved, according to the rules of different languages.

English only has two forms: "singular" and "plural":

  • You have 1 file
  • You have 2 files

Some languages have more complicated rules, however, and several different categories.

Suggested Reading

110 questions
8
votes
1 answer

How can I implement "natural" url scheme routing tables in ASP.NET MVC

I would like to specify my routing tables such that they would feel much more "natural" /Products /Product/17 /Product/Edit/17 /Product/Create Close to the defaults configuration but such that "Index" action would be mapped to the multiples form of…
Roland Tepp
  • 8,301
  • 11
  • 55
  • 73
8
votes
3 answers

In French, plural system treats 0 as "other" instead of "one"

In res/values/strings.xml, I have %d day EN %d days EN And in…
Teybeo
  • 490
  • 4
  • 11
8
votes
3 answers

How do I keep whitespace between {% blocktrans %} and {% plural %} tags without causing msgfmt errors?

I'm rendering some pluralization using the blocktrans tag; here's the relevant snippet in the template file: {% blocktrans count choice_count=choice_count %} You have {{ choice_count }} choice: {% plural %} You have {{ choice_count }}…
3cheesewheel
  • 9,133
  • 9
  • 39
  • 59
8
votes
1 answer

Internationalising sentences with two plural words

Using gettext how should a sentence with multiple numeric variables be made translatable? ngettext only takes one number as the plural parameter. The permutations that should be allowed in the below sentence are "adult and child", "adults and…
dsas
  • 1,650
  • 18
  • 30
8
votes
3 answers

Matching plurals using regex in C#

I'm looking to use regex in C# to search for terms and I want to include the plurals of those terms in the search. For example if the user wants to search for 'pipe' then I want to return results for 'pipes' as well. So I can do this... string s…
SAL
  • 1,218
  • 1
  • 14
  • 34
7
votes
2 answers

Is String#pluralize idempotent?

That is, for any String string, does the following hold? string.pluralize == string.pluralize.pluralize
hoffm
  • 2,386
  • 23
  • 36
7
votes
3 answers

Confused by AngularJS ng-repeat syntax

What is the meaning of the singular/plural syntax in, say, ng-repeat="product in store.products"?
dpren
  • 1,225
  • 12
  • 18
7
votes
4 answers

Using plural strings without number

I'm a bit confused by the .stringsdict documentation (scroll to "Localized Property List File"). Given a number of files, I want to show Save File or save Save Files accordingly. I thought the following would work, but doesn't. In code: NSString…
hpique
  • 119,096
  • 131
  • 338
  • 476
6
votes
2 answers

Rails: Handling a scaffolding, such as "Sheep," that has the same plural and singular form

I'm wanting to create a model called CommunicationMeans (or, alternatively, MeansOfCommunication). However, this is both the singular and plural form of this term. I ran this: $ rails g scaffold CommunicationMeans It generated a model named…
robertwbradford
  • 6,181
  • 9
  • 36
  • 61
6
votes
5 answers

Android Plurals for float values

I would like to use plurals for my Android project. However, the values I provide can be float values. So for instance, when setting 1.5 stars, I want this to understand, it's not 1 star but 1.5 stars.
Tobias Reich
  • 4,952
  • 3
  • 47
  • 90
6
votes
2 answers

Java: Naming convention for plural acronyms

I know there had already been similar discussions on such naming conventions. However, I'm having problem with plural acronyms. public List findAllDvds(DiscHolder holder) {} public List findAllDvd(DiscHolder holder) {} Assuming that I…
Jai
  • 8,165
  • 2
  • 21
  • 52
6
votes
1 answer

const string plus boolean to pluralize in C

I'm surprised string plus boolean has similar effect of ternary operation: int apple = 2; printf("apple%s\n", "s" + (apple <= 1)); If apple <= 1, it will print apple. Why does…
Oxdeadbeef
  • 1,033
  • 2
  • 11
  • 26
5
votes
3 answers

Pluralize in Rails View Issues

I have a question about the pluralize function. In my view, I have the following line of code. It passes in an item with a certain number of votes to determine if it the word "Vote" should be pluralized. <%= pluralize(item.votes, 'Vote') %> My…
5
votes
0 answers

Django: Use a different related_name than "%(class)s" on abstract base classes to account for irregular plurals

I have the following models: from django.db import models from foo.bar.models import Location class AbstractShop(models.Model): location = models.ForeignKey(Location, on_delete=models.CASCADE, related_name="%(class)s") class Meta(self): …
C4X
  • 87
  • 8
5
votes
1 answer

How to add regular string placeholders to a translated plurals .stringdict in swift ios

I want to translate this string using a plurar stringdict in swift for iOS stays at %1$@ stay at %1$@ Using a simple plural without placeholders works, thanks to this question But when I add a string placeholder I get a crash when accessing…
Tom Bevelander
  • 1,686
  • 1
  • 22
  • 31