I've seen some Google apps and code samples using XLIFF tags to wrap variables. I see some great advantages in doing this, especially for replacing non-descriptive format arguments such as %1$s
.
Unfortunately, XLIFF doesn't seem to integrate well into ADT. Take the following string resource, for instance:
<resources
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"
xmlns:tools="http://schemas.android.com/tools">
<string name="share_with_application">
Share your score of <xliff:g id="score" example="1337">%1$s</xliff:g>
with <xliff:g id="application_name" example="Bluetooth">%2$s</xliff:g>!
</string>
</resources>
In the above example, the string is truncated after the first <xliff>
tag. One would also expect the example
attribute to be used, resulting in a graphical preview showing:
Share your score of 1337 with Bluetooth!
Is there presently any merit to using XLIFF tags in my strings resources?
strings.xml
samples in the SDK directory only have the XLIFF namespace declaration and don't actually use the tags. Can you give some more insight into these custom build processes? Are they Jenkins plugins? – Disappointmentlunch
), but I have never done a full firmware build, let alone dissected all the details of what it does. "Are they Jenkins plugins?" -- I highly doubt it; leastways, you do not need Jenkins to build the firmware. – Tatianastring
as non-translatable. So is this safe to use now? ADT still doesn't recognize it, but testing on an actual device seems to be fine. – Uhhuh<xliff:g>
should be safe. Whether anything beyond that works, I can't say. – Tatiana