Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>EDIT:</strong> The option listed in this answer doesn't work. It seems the best way to avoid VCD multi-langage copy-paste is to use T4 templates to generate VCDs are compile time. </p> <hr> <p>Yep, that's actually pretty simple. As long as you don't have CommandSets overlapping you can create a CommandSet for the entire language without mentioning a specific region. Remember, <code>xml:lang</code> is a generic XML attribute and you can use that to your advantage. </p> <p>In the code snippet below we'll specify an <code>en</code> (English) voice command set without the need to mention specific regions. </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.0"&gt; &lt;CommandSet xml:lang="en"&gt; &lt;Example&gt; English example &lt;/Example&gt; &lt;!-- ... --&gt; &lt;/CommandSet&gt; &lt;CommandSet xml:lang="es-ES"&gt; &lt;Example&gt; Non-english example &lt;/Example&gt; &lt;!-- ... --&gt; &lt;/CommandSet&gt; &lt;/VoiceCommands&gt; </code></pre> <p>When we run this code snippet we can see the different Example text showing up in different emulators: </p> <p><img src="https://i.stack.imgur.com/kiB8t.png" alt="VoiceCommands with es-ES text"> <img src="https://i.stack.imgur.com/Nkyp2.png" alt="VoiceCommand with en text"></p> <p>One limitation here is that you can't have a <code>xml:lang="en"</code> CommandSet at the same time as region specific english CommandSets (e.g. <code>xml:lang="en-us"</code>). For the overwhelming majority of apps, that's fine. If you're however embedding a region specific PhraseList you'll have to use alternative strategies (e.g. list of movies only available in specific regions due to copyright restrictions) . One option I've seen before is a T4 template generating a VCD file instead of having a repetitive copy-paste VCD file. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload