Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 840489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:37:54+00:00 2026-05-15T05:37:54+00:00

I am having a bit of a hard time providing localized strings for the

  • 0

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 :

Statuses.resx
Statuses.ro.resx

I do have an enum Statuses :

public enum Statuses
{
    None,
    Working
}

and a convertor :

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();
    }
}

in the view I have a textblock :

    <TextBlock Grid.Column="3" Text="{Binding Status, Converter={StaticResource StatusToMessage}}" />

Upon view rendering the converter is called but no matter what the Thread.CurrentThread.CurrentUICulture is set it always returns the default culture value.

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!!

Going back to the two resource files I am now inspecting their properties :

Build action : Embedded Resource
Copy to output directory : Do not copy
Custom tool : ResXFileCodeGenerator
Custom tool namespace : [empty]

Both resource (.resx) files have these settings. The .Designer.cs resulted files are as follows :

Statuses.Designer.cs :

//------------------------------------------------------------------------------
// <auto-generated>
//     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.
// </auto-generated>
//------------------------------------------------------------------------------

namespace SilverlightApplication5.Resources {
    using System;


    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // 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

Statuses.ro.Designer.cs

[empty]

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.

What is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:37:54+00:00Added an answer on May 15, 2026 at 5:37 am

    It turns out you just have to do one more tintsy thing. As the MSDN article says :

    In Solution Explorer, right-click the
    project name, and then click Unload
    Project to close the project while
    leaving the project icon visible.

    In Solution Explorer, right-click the
    project name, and then click Edit.

    The project file opens in the Visual
    Studio XML Editor.

    In the project file, add the names of
    the region-neutral and specific
    cultures whose satellite assemblies
    your application has created to the
    <SupportedCultures> tag. If your
    application supports multiple
    cultures, use a semicolon (;) to
    separate their names. This list of
    cultures should not include your
    application’s default culture. For
    example, a <SupportedCultures> tag for
    an application whose default culture
    is English (“en”) and that supports
    the English – United States (“en-US”),
    French (“fr”), French – France
    (“fr-FR”), Russian (“ru”), and Russian
    – Russia (“ru-RU”) cultures might appear as follows:

    <SupportedCultures>en-US;fr;fr-FR;ru;ru-RU;</SupportedCultures>

    So, remember to f!@#ingly manual edit the project file and specify which cultures to include in the compilation.

    Now it effing works 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm no DBA, and I'm having a bit of a hard time understanding Oracle's
I am having a bit of a hard time understanding the point in having
Just having a hard time adding a certain bit of given code to add
I'm having a bit of a hard time. Essentially I need a data structure
I'm having a hard time trying to translate a bit of template from 1.2.4
I'm a bit of a noob- and I'm having a hard time... I need
I am having a little bit of hard time understanding ScheduledTask[]. This was added
I'm having a hard time understanding the output of ldd - Especially the processor
Coming from iOS I'm having a pretty hard time with web services in Android.
I am (stuck) using Prototype 1.3.1 and I'm having a hard time moving from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.