I see that there's a pluralCat in each locale file
How to use it with angularJs ? I need translations for locales 'en','de','pl'
So I could use f.e. this
{{cardAmount | sth?}}
and depending on the value of cardAmount it would turn into one output of these
en: 0 cards , 1 card , 2 cards , ...
de: 0 Karten , 1 Karte , 2 Karten , ...
pl: 0 kart , 1 karta , 2 karty , ... , 5 kart
Where would I put my translations ? And where to put the code gluing pluralCat and my translations together
As of version 1.3.3,
$locale.pluralCat
is an internal function - I would not rely on it. I'm sure angular will have more built in localization features in the future.In the meantime I recommend using angular-translate. I'm using it (with one of its plugins -
angular-translate-loader-url
) to dynamically load my translations inJSON
form (originally from aresx
file).I'm translating each noun in both singular and plural form (there are also other forms, like "few" in Polish and Russian...), and using logic like
pluralCat
, deciding in runtime if I should show the translation of Card_Singular or Card_Plural, etc...