N
Novuβ€’11mo ago
Shaun

Pluralization in the Translation Management Platform

Hi there! I am making use of the new translation management platform and was curious what the proper way to handle pluralization is. I see the existing pluralization logic: {{ pluralize count "stringForOne" "stringForMany" }} For the translation management provider, I've been able to use: {{ i18n "container.keyname" count=step.total_count }}
{
"keyname": "{{count}} items"
}
{
"keyname": "{{count}} items"
}
With the i18n provider, how do we make use of different keys based on how many items to use? Thank you in advance!
8 Replies
Pawan Jain
Pawan Jainβ€’11mo ago
@Gali Baum could you please help us here
Gali Baum
Gali Baumβ€’11mo ago
Hi! I am working on that. It should be part of the upcoming release. I'll keep you updated @Shaun @Shaun sorry, I was wrong. It should work for you like this: In the translation file:
"keyWithCount": "{{count}} item",
"keyWithCount_plural": "{{count}} items",
"friend": "A friend",
"friend_male": "A boyfriend",
"friend_female": "A girlfriend"
"keyWithCount": "{{count}} item",
"keyWithCount_plural": "{{count}} items",
"friend": "A friend",
"friend_male": "A boyfriend",
"friend_female": "A girlfriend"
In the editor, it would be used:
{{i18n "welcome.friend" context="male"}}
{{i18n "welcome.keyWithCount" count=7}}
{{i18n "welcome.friend" context="male"}}
{{i18n "welcome.keyWithCount" count=7}}
Gali Baum
Gali Baumβ€’11mo ago
And this will be the output
No description
Gali Baum
Gali Baumβ€’11mo ago
I added an example for gender specific translations
empe
empeβ€’11mo ago
@Shaun Was the information provided helpful? Did it answer your question?
Shaun
ShaunOPβ€’11mo ago
Hi there! Testing now and will report back πŸ™‚ Thank you all for the suggestions Seems to be working! Thank you again πŸ™‚
Linear
Linearβ€’11mo ago
empe
empeβ€’11mo ago
Thanks for the update @Shaun!
Want results from more Discord servers?
Add your server