【发布时间】:2015-10-23 15:51:54
【问题描述】:
我已阅读官方文档并查看其他人在 SO 上所做的事情,但在添加 xliff 标签后我无法让我的字符串工作。我已经导入了 xliff 命名空间
strings.xml
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="string_name">
Your goal is maintaining your levels between
<xliff:g id="test1" example="130">%1$d</xliff:g>
<xliff:g id="test2" example="mg/DL">%2$s</xliff:g>and
<xliff:g id="test3" example="110">%3$d</xliff:g>
<xliff:g id="test4" example="mg/DL">%4$s</xliff:g>
</string>
代码
String raw = getString(R.string.string_name);
return String.format(raw, customGoal.getGoalValueLow(), units, customGoal.getGoalValueHigh(), units);
【问题讨论】:
标签: android internationalization