N
Novu2y ago
SuPP

Custom handlebars helper

How to create custom handlebars helper?
10 Replies
SuPP
SuPPOP2y ago
and where is the plural handlebars helper? from older version
Pawan Jain
Pawan Jain2y ago
Hi @suppmkl You can use pluralize like this
{{pluralize dog_count "dog" "dogs"}}
{{pluralize dog_count "dog" "dogs"}}
We are doing POC on react-email for email editor In future release we are planning to replace handlebar helpers with some other alternative Currently, custom handlebar is not supported which handlebar helper you are looking to add?
SuPP
SuPPOP2y ago
We would like to extend the current plural for the features of the Russian language
Novu_Bot
Novu_Bot2y ago
@suppmkl, you just advanced to level 3!
SuPP
SuPPOP2y ago
as in the i18n library something like - pluralize step.events "пользователь" "пользователя" "пользователей"
Pawan Jain
Pawan Jain2y ago
You can use it like this.
{{pluralize step.events "пользователя" "пользователей"}}
{{pluralize step.events "пользователя" "пользователей"}}
Linear
Linear2y ago
SuPP
SuPPOP2y ago
1 пользователь 2 пользователя 5 пользователей these are the subtleties of the Russian language and that's why we wanted to manually write our helper, I hope you understand what I mean Mike and 1 user wrote you a message Mike and 2 user's wrote you a message Mike and 5 user's wrote you a message but in russian its 3 variants Майк и 1 пользователь написал вам сообщение Майк и 2 пользователя написали вам сообщение Майк и 5 пользователей написали вам сообщение
Pawan Jain
Pawan Jain2y ago
We are working on multi language translations feature, I think that feature will help in this usecase
SuPP
SuPPOP2y ago
okay, thank you very match

Did you find this page helpful?