Choice pattern in properties file

感情迁移 提交于 2019-12-10 04:22:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!