Questions tagged [pluralize]

Pluralize stands for an automate script process, that checks a word (for example, english word "box") and adds its plural end "es", so it comes "boxes", when it is needed to be plural. Term is used in many programming languages.

146 questions
7
votes
2 answers

Pluralization with number and name (swift stringsdict)

I have a stringdict and following sentence I want to translate in several languages: myKey NSStringLocalizedFormatKey My friend %#@name@ has %#@count@. count
max82
  • 223
  • 3
  • 8
7
votes
1 answer

Rails - How to pluralize a sentence?

I know you can pluralize a word in Rails using the pluralize feature. pluralize (3, 'cat') => 3 cats But what I'm trying to do is pluralize a sentence that needs to pluralize multiple words. There are <%= Cat.count %> cats The problem with this,…
Darkmouse
  • 1,941
  • 4
  • 28
  • 52
6
votes
3 answers

AngularJS translation with pluralization using angular-translate

Hello I need to make translations with pluralization depending on a value, but can't find how to do that. for example I have variable peopleCount. peopleCount = 1 translations should be: english: {{ peopleCount }} person likes this lithuanian: {{…
Einius
  • 1,352
  • 2
  • 20
  • 45
6
votes
2 answers

Humanizing sentence when using pluralize in Django

What is the best way to define is/are in a sentence that uses the Django template pluralize filter? For example:

Your item{{ items|length|pluralize }} is/are currently being processed and will ship soon.

tomcounsell
  • 4,991
  • 3
  • 34
  • 34
6
votes
4 answers

EF pluralize table's name on generating database from model

I have some models and tables in EF that you can see one of those here: Now when I want to generate database from model it adds 's' to name of tables in generated sql: CREATE TABLE [dbo].[Options] ( [Id] int IDENTITY(1,1) NOT NULL, [Name]…
Majid
  • 13,853
  • 15
  • 77
  • 113
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
2 answers

Using blocktrans with "with" and "count" keywords together

Is it possible to use {% blocktrans %} with "with" and "count" at the same time? The documentation describes only the separate using: {% blocktrans with foo|filter as bar and baz|filter as boo %} {% blocktrans count var|length as count %} I need…
Gregory
  • 473
  • 8
  • 14
5
votes
1 answer

Rails 4: pluralizing model_name.human using count: 123 doesn't work

From Rail 3, I'm used to do this: User.model_name.human count: 2 # "Users" This doesn't seem to work in Rails 4? [1] base » User.model_name.human count: 2 => "User" While pluralizing a simple string seems to work: [2] base » "User".pluralize =>…
Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152
4
votes
1 answer

rails 3 not pluralizing table name

I am trying to migrate from rails 2 to rails 3. I am facing a strange problem. The whole of application doesn't seem to pluralize the table names. Mysql::Error: Table 'r_database.country_data' doesn't exist: But my table has country_datas as the…
Gaurav Shah
  • 5,223
  • 7
  • 43
  • 71
4
votes
3 answers

Where is EnglishPluralizationService in EF Core 2.0?

EF Core 2.0 still has its conventions and it can change plural to singular and singular back to plural. Thus it definitely has the pluralization service built into it. Yet I can't find this service to use it for other purposes. In EF 6, I would…
4
votes
4 answers

pluralize and singularize for spanish language

sorry for my english... I have a rails application developed to spain, therefore, all content is in spanish, so, I have a search box to search in a mysql database, all rows are in spanish, I'd like to improve my search to allow to users to search…
el_quick
  • 4,656
  • 11
  • 45
  • 53
4
votes
3 answers

How to handle pluralisation in PHP

I have an app, presumably an API, which I am working on. The app returns in JSON format for the requested resources. So I have a project management application, where the structure is similar to what is…
4
votes
3 answers

pluralisation/depluralisation

Does php have any function to deal with pluralising or depluralising words? Obviously it's pretty easy to take off or replace the 's' at the end of words like 'apple' but other words are not so simple. If php doesn't have a native way of dealing…
significance
  • 4,797
  • 8
  • 38
  • 57
3
votes
1 answer

Rails 3 - form_for pluralization causing path/method error on "new" action but not on "edit"

When I go to the path: /genre/new in my application I get this error: myapp/app/views/genre/_form.html.erb where line #1 raised: undefined method `genres_path' for #<#:0x007fdcb39e8080> However when I go to /genre/:id/edit…
Don Leatham
  • 2,694
  • 4
  • 29
  • 41
3
votes
2 answers

Does the pluralisation overload of QObject::tr() translate the %n to a local number?

There are two forms of the QObject::tr() function I have been using for translating strings which contain numbers: tr("There are %n foo(s)", 0, foo.size()); tr("%1: %2").arg(QLocale().toString(bar.size())).arg(bar.name()); These account for most…
Samuel Harmer
  • 4,264
  • 5
  • 33
  • 67
1 2
3
9 10