Open Uwuewsky opened 4 months ago
Related: in Chinese we normally add a classifier between the number and the noun, so the current way of prepending the number directly looks awkward in Chinese too.
I have been thinking of specifying how a language needs to use the number, classifier, and noun in JSON, probably something to this effect, and I think this should also be able to solve your issue.
"name": {
"noun": { "str_sp": "strawberries" },
"classifier": { "str": "%1$d handful of %2$s", "str_pl": "%1$d handfuls of %2$s" },
}
Here %1$d
would be the number, %2$s
would be the noun, and handful of
is a classifier-like construct in English, but in Chinese we use classifier for almost all nouns.
Then we can use the strings in C++ code like this:
// always prepend a number
str.translated_count( count ); // 1/2 handful(s) of strawberries, 1/2 book(s)
// omit the number `1` if allowed by the language
str.translated_multi( count ); // strawberries, 2 handfuls of strawberries
// omit the number if allowed by the language
str.translated( count ); // strawberries, book(s)
This should also be able to solve your problem by always formatting the number in the classifier
field. It should also be useful for classifier-like constructions in English and other languages such as a handful of something
, so instead of saying you pick up your handful of strawberries
, it says something more sensible like you pick up your strawberries
. Furthermore, this should allow localizing to languages that use the number, classifier, and noun in an order other than number-classifier-noun
.
But there's the problem of adding too many unnecessary strings for other languages and I didn't quite have the time to work on it either.
I also heard there are more sophisticated localization libraries out there so we could probably use one of these instead, but I don't know if Transifex supports such libraries.
Describe the bug
Attach save file
N/A
Steps to reproduce
g
et some rocks,d
rop them down:Slightly different case, in the aiming menu it would be better if the ammo name was always in the singular. Now it is in plural, you can see it if the ammo has some noun in its name, like grenades.![b3-1](https://github.com/CleverRaven/Cataclysm-DDA/assets/99945024/8ad6145a-000c-412c-84c2-7913566da322)
&
-create and*
-build menu, items with charges are always displayed in the singular, e.g. nails.Expected behavior
Not dropping 1 is also an option
Screenshots
No response
Versions and configuration
VERSION: cdda-experimental-2024-03-23-0552 bbda3e4
Additional context
No response