title: Using embedded resources in Silverlight (4) - other cultures not being compiled
body: <p>I am having a bit of a hard time providing localized strings for the UI in a small Silverlight 4 application. Basically I've put a folder "Resources" and placed two resource files in it :</p>
  
  <pre><code>Statuses.resx
  Statuses.ro.resx
  </code></pre>
  
  <p>I do have an enum Statuses :</p>
  
  <pre><code>public enum Statuses
  {
      None,
      Working
  }
  </code></pre>
  
  <p>and a convertor : </p>
  
  <pre><code>public class StatusToMessage : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          if (!Enum.IsDefined(typeof(Status), value))
          {
              throw new ArgumentOutOfRangeException("value");
          }
          var x = Statuses.None;
          return Statuses.ResourceManager.GetString(((Status)value).ToString(), Thread.CurrentThread.CurrentUICulture);
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>
  
  <p>in the view I have a textblock :</p>
  
  <pre><code>    &lt;TextBlock Grid.Column="3" Text="{Binding Status, Converter={StaticResource StatusToMessage}}" /&gt;
  </code></pre>
  
  <p>Upon view rendering the converter is called but no matter what the Thread.CurrentThread.CurrentUICulture is set it always returns the default culture value.</p>
  
  <p>Upon further inspection I took apart the XAP resulted file, taken the resulted DLL file to Reflector and inspected the embedded resources. It only contains the default resource!!</p>
  
  <p>Going back to the two resource files I am now inspecting their properties :</p>
  
  <p>Build action : Embedded Resource
  Copy to output directory : Do not copy
  Custom tool : ResXFileCodeGenerator
  Custom tool namespace : [empty]</p>
  
  <p>Both resource (.resx) files have these settings. The .Designer.cs resulted files are as follows :</p>
  
  <p>Statuses.Designer.cs :</p>
  
  <pre><code>//------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //     This code was generated by a tool.
  //     Runtime Version:4.0.30319.1
  //
  //     Changes to this file may cause incorrect behavior and will be lost if
  //     the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  
  namespace SilverlightApplication5.Resources {
      using System;
  
  
      /// &lt;summary&gt;
      ///   A strongly-typed resource class, for looking up localized strings, etc.
      /// &lt;/summary&gt;
      // This class was auto-generated by the StronglyTypedResourceBuilder
      // class via a tool like ResGen or Visual Studio.
      // To add or remove a member, edit your .ResX file then rerun ResGen
      // with the /str option, or rebuild your VS project.
      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
      [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
      [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
      internal class Statuses {
  
  // ... yadda-yadda
  </code></pre>
  
  <p>Statuses.ro.Designer.cs</p>
  
  <p>[empty]</p>
  
  <p>I've taken both files and put them in a console application and they behave as expected in it, not like in this silverlight application.</p>
  
  <p>What is wrong?</p>