eligrey / l10n.js

Passive localization JavaScript library
http://purl.eligrey.com/l10n.js
Other
392 stars 68 forks source link

Can you do translations with numbers? #40

Open cyphix333 opened 7 years ago

cyphix333 commented 7 years ago

Just wondering what if you wanted to do translation on a string that has a number in it?

For example:

There (is,are) {n} cat(s)

So what it would do is find the translation string to translate the words, choose the correct term between is and are, show the locale specific number based on what number you passed in (somehow) and also display either the non-plural or plural version of the word cat.

...or is this outside this library's scope?

Thanks!

eligrey commented 3 years ago

This is outside of scope for this particular library, though I may make a new more modern library (perhaps even backwards compatible with this one if people are interested) in the future. 👍

cyphix333 commented 3 years ago

It's been some time since I posted this, but sure, would be interested in something like that :)