Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Unfortunatly the automatic generation of the AppResources.resx files only seems to work for Windows Phone 8 apps. For Windows Phone 7 apps you have to do it all manually. This is how to localize your app in Windows Phone 7:</p> <p><strong>Step 1:</strong> Choose languages in "Supported Cultures" in project properties (same as for WP8)</p> <p><strong>Step 2:</strong> Right click on project in solution explorer -> Add -> New Item...</p> <p><strong>Step 3:</strong> Select the type <code>Resources File</code> and name it <code>AppResources.resx</code></p> <p><strong>Step 4:</strong> Open the <code>AppResources.resx</code> file and change the <code>Access Modifier</code> to <code>Public</code>:</p> <p><img src="https://i.stack.imgur.com/slWBM.png" alt="enter image description here"></p> <p><strong>Step 5:</strong> Repeat step 2, 3, and 4 for every other language you want to use, naming the file <code>AppResources.&lt;culture&gt;.resx</code>, for example <code>AppResources.sv.resx</code> for Swedish.</p> <p><strong>Step 6:</strong> Create a class named "LocalizedStrings.cs" with the following code:</p> <pre><code>public class LocalizedStrings { private static AppResources _localizedResources = new AppResources(); public AppResources AppResources { get { return _localizedResources; } } } </code></pre> <p><strong>Step 7:</strong> Open App.xaml, and add the following to <code>&lt;Appllication.Resources&gt;</code>:</p> <pre><code>&lt;Application.Resources&gt; &lt;local:LocalizedStrings x:Key="LocalizedStrings" /&gt; &lt;/Application.Resources&gt; </code></pre> <p><strong>Step 8:</strong> You can now use the translations in the following way:</p> <pre><code>&lt;TextBlock Text="{Binding AppResources.Title, Source={StaticResource LocalizedStrings}}" /&gt; </code></pre> <p>Where <code>Title</code> is the <code>Name</code> column in the AppResources.resx files.</p> <p><img src="https://i.stack.imgur.com/2WIdC.png" alt="enter image description here"></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