Tag Archives: i18n

Pluralization in Java

Any website that needs to deal with international customers will naturally have to support multiple languages. In this regard, Java has pretty good support for this and there are a plethora of online resources that show you how. The trouble is that there are almost no non-noddy examples for pluralizations. Pluralizations are simple in English but a nightmare in languages like Polish and Russian where the multiple suffix is almost random!

Thankfully one of my co-workers Stuart came across the excellent if little known ChoiceFormat class that provides much of the functionality you need. Being a good lad he wrote a blog post about it and in a nice show of karma, he was given an even better library to use. Supported by IBM, the ICU4J library is used by almost everyone including IBM themselves, Google and Rolls-Royce and offers all the features you need for an internationalization library.