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
5
votes
1 answer

How to handle pluralization in Hogan

I'm using Hogan.js, which is compatible with the Mustache spec. And im having trouble implementing a solid way of doing pluralization. I would like to keep using Hogan and use http://i18next.com/ for i18n handling doing something like this works for…
Paul Scheltema
  • 1,993
  • 15
  • 25
5
votes
1 answer

Plural Name in Association in Rails

I have user model and a car model I want to have a model which will hold the settings for each car and each user so I do class CarSettings < ActiveRecord::Base belongs_to :user belongs_to :car end for user: has_many :car_settings and for…
4
votes
1 answer

Can you inject variables into the text when using Zend_Translate in plural mode

I'm trying to use Zend_translate in a situation where I have to inject a variable value into the resulting string and have the string respect plural form. Using the regular (non-plural) view helper $this->translate() in a view script I can inject a…
Jens Wegar
  • 4,147
  • 4
  • 29
  • 34
4
votes
2 answers

Pluralization in vue i18n

Hi i am trying to pluralize based on https://kazupon.github.io/vue-i18n/guide/pluralization.html imageCount== 1 ? $t("message.imageMessage", 1, { imageCount}) : $t("message.imageMessage", imageCount, { imageCount …
user11982170
4
votes
1 answer

xgettext won't scan plural form

I use Poedit for my gettext i18n and that works fine. I use ZF2 where there are view helpers to integrate the translations. One is translate, the other translatePlural. Usage: translate('Welcome') ?>
Jurian Sluiman
  • 13,498
  • 3
  • 67
  • 99
3
votes
1 answer

In ICU, is it possible to use custom plural rules instead of CLDR rules

So I want to use a different plural rule than what is in the CLDR. I'm using ICU through PHP intl extension, and say I have something like this: $msg = new MessageFormatter('ar', '{0,plural, zero {zero-ar}' . 'one…
Basel Shishani
  • 7,735
  • 6
  • 50
  • 67
3
votes
1 answer

How to add pluralization to weblate translations files?

I am trying out weblate self hosting package (MaxOs Docker, to test it out) to manage my translations for an iOS and Android app. I see that pluralisation is possible, but I haven't found a way to add these to a project. When clicking on start new…
3
votes
4 answers

Plural and Singular terms in PHP

I am doing an amount of users check for our website, below is the code. How can i use the word "user" if there is only 1 account and how can i use "users" if there is >1. code: $result = mysql_query("SELECT * FROM users WHERE…
AAA
  • 3,120
  • 11
  • 53
  • 71
3
votes
1 answer

How to represent negative numbers in plural resources in android

I was wondering if there is any easy way to format an integer based on negative, zero and positive using the plural resources mechanism in android? My desired answer would be if getRemaining() < -1 then "|getRemaining()| days ago" if getRemaining()…
Samuel Robert
  • 10,106
  • 7
  • 39
  • 60
3
votes
1 answer

rails 4 undefined method `_index_path' when using form_for with plural class name

I've browse a lot of question over SO for this error and I didn't find the correct answer unfortunately. I've created the class Avis (which, in French, takes an s no matter if it's singular or plural.) using rails generate scaffold Avis…
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
2
votes
2 answers

Handle Ruby on Rails resource when the singular is also plural?

Whats the best way to handle a singular resource, that itself is plural. For example a "settings page", that displays a selection of different settings. As I am displaying a single "Settings" instance, I would expect to use the show action, but…
dangerousdave
  • 6,331
  • 8
  • 45
  • 62
2
votes
1 answer

What if the model in the ActiveRecord is an always plural word?

I am developing a Rails app which should rely on existing database. There are a couple of table names there which are the always plural words, like "Series". Application is not working correctly with the models associated with them. How would you…
lyuba
  • 6,250
  • 7
  • 27
  • 37
2
votes
1 answer

"localizedStringWithFormat" change the language without restarting the app

I successfully implemented plural localization in my app. But if I change the app language, localizedStringWithFormat still returns the plural in previous language. If I restart the app, the plural will be returned in correct language (the language…
Pixeelix
  • 46
  • 4
2
votes
2 answers

How can I make my web application understand the difference between singular and plural?

When a user on a popular website gets a response, they are (rather embarrassingly) told that they have "1 responses" (see illustration). I'm sure it must be easy to determine whether they have one response and strip the 's' from the end of the…
johnsyweb
  • 136,902
  • 23
  • 188
  • 247
2
votes
1 answer

Remove thousand separator from localized numerical values in swift

I am trying to get localized string along with singular/plural localization from both Localizable.stringsdict and Localizable.strings using String.localizedStringWithFormat() method. But this method returns string with thousand separator/group…
Rubaiyat Jahan Mumu
  • 3,887
  • 1
  • 33
  • 35