This is a Gradle plugin that will resolve placeholders in your XML strings at build time. There's no need to write any Java or Kotlin code in order to use it, just place your placeholders in string templates and build your project, e.g:
Input:
xml <resources> <string name="app_name">My App Name</string> <string name="template_welcome_message">Welcome to ${app_name}</string> </resources>
Output:
xml <!-- Auto generated --> <resources> <string name="welcome_message">Welcome to My App Name</string> </resources>
The templates are defined by the "template_" prefix, which is removed for the autogenerated resolved string.
This plugin takes into account multi language strings and flavors. More info on the repo's page: https://ift.tt/2R6jvZS
from The Android Arsenal
No comments:
Post a Comment