android xml中的xliff属性

<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="sd_card_available">Space available:<xliff:g id="available_size">%1$s</xliff:g></string>
<string name="sd_card_size">SD card:<xliff:g id="total_size">%1$s</xliff:g></string>

%n$ms:代表输出的是字符串,n代表是第几个参数,设置m的值可以在输出之前放置空格 
%n$md:代表输出的是整数,n代表是第几个参数,设置m的值可以在输出之前放置空格,也可以设为0m,在输出之前放置m个0 
%n$mf:代表输出的是浮点数,n代表是第几个参数,设置m的值可以控制小数位数,如m=2.2时,输出格式为00.00 

  setTextView(R.id.sd_card_capacity, getString(R.string.sd_card_size, Util.convertStorage(sdCardInfo.total)));

  另 -----------------------------------  不加xliff的方法 (转的,没有测试过)

<string name="alert">我的名字叫%1$s,我来自%2$s</string>    
String sAgeFormatString sAgeFormat1= getResources().getString(R.string.alert);
String sFinal1 = String.format(sAgeFormat1, "李四","首都北京"); 
原文地址:https://www.cnblogs.com/toolbear/p/5139642.html