3 ms·
For just this situation, Java offers the MessageFormat (and the ChoiceFormat refinement) form.applyPattern( "There {0,choice,0#are no files|1#is one file|1
by locopati 16y ago
For just this situation, Java offers the MessageFormat (and the ChoiceFormat refinement)
form.applyPattern(
"There {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}.");
http://download.oracle.com/javase/6/docs/api/index.html?java/text/MessageFormat.html http://download.oracle.com/javase/6/docs/api/index.html?java...
- julian37 16y agoYou haven't actually read the article, have you?
- locopati 16y agoActually, I did give the article a quick read. He's raising intersting points around the problems of localization and showing how to solve those problems in Perl using logic to do something that Java lets you manage somewhat easily. What's not included in my brief comment on MessageFormat, is the other part of the equation - Java also provides Locale and Property files for managing strings. My comment was intended to provide info to those Java coders out there who may not be aware of such things, since the Java API has a lot of nooks and crannies like that.