复数字符串资源中文总是获得quantity为other的字符串
来源:互联网 发布:质量问题淘宝怎么陪 编辑:程序博客网 时间:2024/05/21 18:49
<plurals name="unicornCount"> <item quantity="one">One unicorn</item> <item quantity="other">%d unicorns</item></plurals>
String s = getResources().getQuantityString(R.plurals.unicornCount, 1, 1);Log.d(this.getClass().getName(), s);s = getResources().getQuantityString(R.plurals.unicornCount, 3, 3);Log.d(this.getClass().getName(), s);
因为中文没有复数语法,所以当语言是中文时,将总是获得quantity为other的字符串
Although historically called "quantity strings" (and still called that in API), quantity strings should only be used for plurals. It would be a mistake to use quantity strings to implement something like Gmail's "Inbox" versus "Inbox (12)" when there are unread messages, for example. It might seem convenient to use quantity strings instead of an "if" statement,but it's important to note that some languages (such as Chinese) don't make these grammatical distinctions at all, so you'll always get the "other" string.
0 0
- 复数字符串资源中文总是获得quantity为other的字符串
- 关于R.plural的quantity配适总是用other的原因
- 获得ASP的中文日期字符串
- exe中获得资源字符串
- 带中文的字符串转换为url
- 获得字符串的宽度
- 转UTF-8为字符串、中文字符串
- android字符串的单复数处理
- 如何读取资源文件里的中文字符串
- 如何读取资源文件里的中文字符串
- python 中文字符串处理-获得子串
- Java 按字节获得字符串(中文)长度
- 校验字符串是否为中文
- 判断字符串是否为中文
- 判断字符串是否为中文
- Android字符串单复数
- Android字符串单复数
- go字符串复数
- spring-boot初尝试
- 正则表达式的简单使用
- code
- [CF721C]Journey
- Maven的POM文件详解
- 复数字符串资源中文总是获得quantity为other的字符串
- 运算放大器输入过压保护:箝位与集
- python之连接mysql
- h5本地存储localStorage,sessionStorage
- JAVA BigInteger类 方法使用
- 实现push,pop,max为O(1)的栈
- c3p0连接池参数解释
- Unity3D Shader 新手教程(2/6) —— 积雪Shader
- php ajax生成excel并下载