title: Improving Android string resources with XLIFF
body: <p>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 <code>%1$s</code>.</p>
  
  <p>Unfortunately, XLIFF doesn't seem to integrate well into ADT. Take the following string resource, for instance:</p>
  
  <pre><code>&lt;resources 
      xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" 
      xmlns:tools="http://schemas.android.com/tools"&gt;
  
      &lt;string name="share_with_application"&gt;
          Share your score of &lt;xliff:g id="score" example="1337"&gt;%1$s&lt;/xliff:g&gt;
          with &lt;xliff:g id="application_name" example="Bluetooth"&gt;%2$s&lt;/xliff:g&gt;!  
      &lt;/string&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p><img src="https://i.imgur.com/W61AY.png" alt="Graphical Layout preview"></p>
  
  <p>In the above example, the string is truncated after the first <code>&lt;xliff&gt;</code> tag. One would also expect the <code>example</code> attribute to be used, resulting in a graphical preview showing:</p>
  
  <blockquote>
    <p>Share your score of 1337 with Bluetooth!</p>
  </blockquote>
  
  <p>Is there presently any merit to using XLIFF tags in my strings resources?</p>