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
2
votes
3 answers

What should I do if I named a Model in Rails 3 plural?

I created a model called UserHasMessages based on some SO postings. I think this seems to be creating some challenges for me: How do I reference it with has_many? Should I use has_many :user_has_messageses? How do I do joins? I have tried…
Satchel
  • 16,414
  • 23
  • 106
  • 192
2
votes
0 answers

Syntax for plural label

In view of 5.7 laravel app with I want to number of items considering plural, like {{ count($activeVoteCategories) }} vote @if(count($activeVoteCategories) > 1)s @endif But resulting label is invalid, as there is unnessary space before last "s"…
user2054381
2
votes
0 answers

Localizable.stringsdict: getting English to use the "two" key

I have an object with an executionCount property and I'd like to display to the user how many times the object will execute. For example, in English: X will execute once X will execute twice X will execute %d times I have created a…
nyg
  • 2,380
  • 3
  • 25
  • 40
2
votes
1 answer

Using ".stringsdict" file with 'localizedStringWithFormat' --> Are NUMERALS localized for you?

I am trying to produce the following localized string: "In ___ day(s)" --> (ex: In 5 days) To accomplish this, I've gone down the .stringsdict route: In %d Days NSStringLocalizedFormatKey
user1661421
2
votes
1 answer

.NET EF 6 Pluralization with prefix in table names

Plural table names are default convention in EF. but when I have added the prefix I can not make names anymore plural unfortunately. Any ideas? protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Types() …
DrArqon
  • 153
  • 1
  • 11
2
votes
1 answer

Make it work: ICU/php-intl mnemonic tag "few" for pluralization formatting

ICU message formatting doesn't seem to work for me. Here's the example: $n = 22; $f = MessageFormatter::create('ru', '{n, plural, one{корова} few{коровы} many{коров} other{коров}}'); echo $n.' '.$f->format(['n' => $n])."\n"; I get 22 коров in…
Alex Kovytin
  • 513
  • 1
  • 4
  • 8
2
votes
2 answers

AngularJs pluralCat

I see that there's a pluralCat in each locale file How to use it with angularJs ? I need translations for locales 'en','de','pl' So I could use f.e. this {{cardAmount | sth?}} and depending on the value of cardAmount it would turn into one output…
Allisone
  • 8,434
  • 4
  • 32
  • 54
2
votes
2 answers

Use custom locale for plurals

I am trying to override the locale to use Czech locale no matter what is set in the phone. However, although when I try to get the current locale, it returns czech, but for plurals, it acts like it still takes the real phone locale. Here is my…
vandus
  • 3,248
  • 3
  • 30
  • 44
2
votes
3 answers

Is there a one-liner for dealing with singular/plural words in common languages?

All too often I see websites do things like 1 views, 1 days left, or 1 answers. To me this is just lazy as its often as easy to fix as something like: if(views == 1) print views + " view" else print views + " views" What I want to know is if…
eliot
  • 1,319
  • 1
  • 14
  • 33
1
vote
0 answers

SSRS Report Manager rules for generating Models from Data Source with plural table names

I am using the SSRS Report Manager web interface to generate Data Models for a SQL Server 2008 R2 Data Source. The database contains a number of tables with names which are plurals. In the generated Data Models, the corresponding entities have names…
Chris Mc
  • 25
  • 3
1
vote
0 answers

Is it possible to use pluralization with remote push notification on Android and iOS?

I had a look at this question and also this post. None of them really answer if it is possible or not, at least not authoritatively. What I'm trying to achieve is to send notification to my apps¹, this notification does not contain text itself but…
user3056783
  • 2,265
  • 1
  • 29
  • 55
1
vote
2 answers

Making Change with Singular/Plural Differentiation

I am in a beginner scripting class where we need to write some code that makes change based on integer input. It also needs to print the correct plurality for each coin type. I am having some trouble getting my code to work, as it stops at the first…
1
vote
0 answers

objective-C: is it possible to use plural rules in binding with pattern?

I have the well known problem of "number of selected out of total": if I work in the xib I use DisplayPattern Value1 and Value2 where the pattern is "#{value1}@ selected out of %{value2}@" and it works. Now I'd want to localize my app: so I inserted…
max.me
  • 105
  • 7
1
vote
0 answers

Plurals "one" is not working - always used "other" resource

I want to use Android's plurals resource. Most questions out there mentioned that "one" is working but the other quantities are not; But I am encountering the opposite... Strings.xml
Sira Lam
  • 5,179
  • 3
  • 34
  • 68
1
vote
1 answer

How can I make a bash variable change a word between singular and plural endings based on a count of time?

I am not a good bash scripter yet. In the following example script, I am trying to move through steps, check the amount of time elapsed since the step started, and use the correct singular or plural ending to describe the amount of time that has…
David Moore
  • 90
  • 1
  • 8