Android <xliff:g>标签 以及字符串格式化

来源:互联网 发布:软件著作权版本号 编辑:程序博客网 时间:2024/05/18 07:13

Calendar 应用中使用的

<resources  xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" >

 <!-- Reminder format strings -->
    <plurals name="Nminutes">
        <!-- This is the label for a 1-minute reminder. -->
        <item quantity="one">1 minute</item>
        <!-- This is the label for 2 or more minutes. The actual number of
             minutes is a parameter. -->
        <item quantity="other"><xliff:g id="count">%d</xliff:g> minutes</item>
</plurals>


使用:

 String weekString = getResources().getQuantityString(R.plurals.weekN, mWeekNum,
                    mWeekNum);
            mWeekTextView.setText(weekString);


参考:http://blog.csdn.net/wufen1103/article/details/7846691



0 0
原创粉丝点击