问题
I have a properties file with messages and I want to handle some special cases of plural. Now I use:
xxx.yyy.plural=test{0,choice,2#y}
but it formats 12 as 'testy' also. How can I specify 2 as exact match?
回答1:
I found an answer. It seems that choice statement in properties file works properly only if more than one choice is specified. So you have to specify at least one "else branch" If i rewrite my example:
xxx.yyy.plural={0,choice,2#testy|2<test}
来源:https://stackoverflow.com/questions/12138279/choice-pattern-in-properties-file