【发布时间】:2017-04-12 03:24:42
【问题描述】:
我的项目有多个本地化版本。
现在我必须为不同的 buildTypes 替换所有 strings.xml 文件中的某个单词。例如,假设我有这个:
<string>My name is Bill</string>
<string>Bill is on duty today</string>
在另一个 buildType 中我需要有
<string>My name is Will</string>
<string>Will is on duty today</string>
我该怎么做(可能通过 Gradle)?
【问题讨论】:
-
使用风味。通过阅读this
-
<string>My name is %s</string><string>%s is on duty today</string>...getString(id, "Bill"); -
@Selvin,谢谢,但我知道这种方式,无法使用此解决方案
标签: android gradle preprocessor