eugene-manuilov / react-gettext

Tiny React library for implementing gettext localization in your application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ngettext problem

artemkhalygov opened this issue · comments

Is it possible to translate something like this:

ngettext('only {{ count }} night', 'only {{ count }} nights', 3)

As I see right now - there is no way to do it...

hi @artemkhalygov

do you mean if it is possible to substitute {{ count }} with particular value passed into ngettext function as the third argument? If yes, then you are correct, it is not possible to do it automatically with this library. This library is intended to translate strings and don't support templating. You need to do it on your own after the string is translated.