149 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
4
votes
2
answers
296
views
Swift Automatic Grammar Agreement Inflection: make singular string from the plural one: days -> day
I've created the following data model:
import Foundation
struct Effort {
let amount: Int
let unit: String
var text: String {
"\(amount) \(unit)"
}
var ...
0
votes
2
answers
476
views
Rails I18n pluralization without an explicit count number
Rails provides a built-in pluralization method for String, e.g., "apple".pluralize returns "apples" and "apple".pluralize(1) does "apple" (see this question). ...
5
votes
1
answer
1k
views
Xcode 15 strings catalog plurals without format
In stringsdict it was possible to define a format separately from the translation so you could do something like "picker.days" which you could pass in an integer and it would return you only ...
0
votes
1
answer
153
views
SwiftUI previews not working with pluralization using stringsdict files
Has anyone successfully gotten plurals to preview in SwiftUI?
Apple uses a .stringsdict file for handling pluralization. However, when attempting to render that string in a preview, for example:
Text(&...
3
votes
1
answer
228
views
How do you get plural currency name with JS?
I know I can use Intl.DisplayNames to get the singular form (e.g. US Dollar).
const currencyNameEnUs = new Intl.DisplayNames( 'en-US', { type: 'currency' } );
const currencyCode = 'USD';
console.log( ...
-1
votes
1
answer
40
views
So I am trying to pluralize my pennies but it keeps failing my pipeline
Trying to get the following to pass my pipeline it is failing to pluralize. The rest of the change passed the pipeline just can't seem to get the pennies to pass. Help with this would be greatly ...
-1
votes
1
answer
160
views
Kotlin: Pluralize amount of currency
I want to write some code to determine if I need to write "Quarter" or "Quarters" depending on the amount.
Up to now I have the following code:
fun main(args: Array<String>) {...
0
votes
0
answers
64
views
Using more than one conditions on placeholder (JS)
I'm starting to learn JS and one of my tasks is to create a simple code to give the system time. I also wanted to increment it so it would give hour or hours based on what value the variable had (if ...
0
votes
0
answers
90
views
Plurals in rails mailer don't work with TextHelper
I'm trying to pluralize a word in the subject of a rails mailer :
these two don't working :
subject: "Réservation pour #{pluralize(@step.number_of_people.to_i, "personne")}"
...
1
vote
1
answer
685
views
Django pluralize person as people
trying to output the correct plural value in Django template when count is more than 1.
<p>{{ review.markers.helpful.count }} person{{ reviews.markers.helpful.count|length|pluralize }} found ...
0
votes
0
answers
219
views
How to pluralize a label based on a number input
I have a number input controlled by (+) and (-) buttons. I added a unit label after the number with a span following the input, but now am having trouble figuring out how to pluralize the unit when ...
1
vote
0
answers
148
views
How to "forze" pluralize in EF Core Scaffold-Dbcontext
When scaffolding an existing DB Model there are several table names that end with an s. Like SaleOrderPos beeing pos short for position.
I want to pluralize the DBSet but keep intanct the original ...
-1
votes
3
answers
394
views
How can I combine two functions using default value?
I would like to combine these two function but I'm on trouble how to do it. Could anyone help me please?
fun String?.pluralize(count: Int): String? {
return if (count != 1) {
this + 's'
...
0
votes
0
answers
216
views
How to display "0" when using 'pluralize' in Django templates?
Edit: The issue isn't related to pluralize. See comment.
How do I make pluralize to display 0? In the database are 2 book listings ('books'), 6 physical copies ('book_instances'), and 0 available for ...
3
votes
2
answers
1k
views
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 ...