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 3615058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:19:35+00:00 2026-05-18T22:19:35+00:00

I am reading one book in WPF which provides a method for creating an

  • 0

I am reading one book in WPF which provides a method for creating an application for localisation purposes.What he suggested and the same I did was:

1)edit the project file .csproj and add an element en-US to create a localised assembly that contains en-US localised embedded baml.When I compiled the project it created a sub-folder en-US that contained the en-US localised embedded baml.I took it’s backup.

2)I did the same for fr-FR and created a backup for it.

3)Next I placed both the created subfolders in the application folder with the names en-US and fr-FR.

The book suggests that that if I change the culture setting to fr-FR(via control panel regional settings) the fr-FR localised assembly will be used.
But, I found that no matter what the culture is, it’s using the en-US one. I know this because I changed the culture to fr-FR and deleted the fr-FR folder, but still the app. is running and when the en-US one is deleted, it throws an exception.

Can anyone clarify where am I doing/understanding wrong?

Here are the words of the book:
Preparing an Application for Localization
The next step is to switch on localization support for your project. This takes just one
change—you need to add the following element to the .csproj file for your project anywhere
in the first element:
en-US
This tells the compiler that the default culture for your application is U.S. English (obvi
ously, you could choose something else if that’s appropriate). Once you make this change, the build process changes. The next time you compile your application, you’ll end up with a sub-folder named en-US. Inside that folder is a satellite assembly with the same name as your application and the extension .resources.dll (for example, LocalizableApplication.resources.dll).
This assembly contains all the compiled BAML resources for your application, which were previously stored in your main application assembly.
Now, when you run this application, the common language runtime (CLR) automatically
looks for satellite assemblies in the right directory based on the computer’s regional settings and loads the correct localized resource. For example, if you’re running in the fr-FR culture, the CLR will look for an fr-FR subdirectory and use the satellite assemblies it finds there.
That means that if you want to add support for more cultures to a localized application, you simply need to add more subfolders and satellite assemblies without disturbing the original application executable.
When the CLR begins probing for a satellite assembly, it follows a few simple rules of
precedence:
1. First, it checks for the most specific directory that’s available. That means it looks for a satellite assembly that’s targeted for the current language and region (such as fr-FR).
2. If it can’t find this directory, it looks for a satellite assembly that’s targeted for the current language (such as fr).
3. If it can’t find this directory, an IOException exception is thrown.

  • 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-18T22:19:35+00:00Added an answer on May 18, 2026 at 10:19 pm

    The Resource Manager in .NET uses the CurrentUICulture flag to decide which localized assembly to load, rather than the CurrentCulture flag. CurrentUICulture represents the native language of the version of Windows that you are running, whereas CurrentCulture represents your current regional setting, set via Control Panel.

    Another way to think about this is that there are two independent things that your application can ask about your user:

    1) What language does he speak? (CurrentUICulture)

    2) Where is he located? (CurrentCulture)

    The answer to #1 should dictate the language that you use for displaying UI elements, i.e. which localized resource file to load.

    The answer to #2 should dictate how you display things like numeric strings and currency values. This is automatically handled by numeric/currency conversion to string values in their ToString methods.

    To double-check the value of these two properties, you can do something like this:

            Console.WriteLine("CurrentCulture={0}, CurrentUICulture={1}", CultureInfo.CurrentCulture, CultureInfo.CurrentUICulture);
    

    To change CurrentCulture, you just change your location in Control Panel | Region and Language | Formats.

    The change CurrentUICulture, you can do one of the following:

    • Test on a non-English version of Windows. (E.g. in a VM)
    • Use a MUI pack in Windows 7
    • Add an override in your code for testing purposes, typically based on a .config file setting, where you explicitly set the value of CultureInfo.CurrentUICulture.

    Example of overriding UICulture, based on an UICulture setting in app.config is shown below. You’d set UICultureOverride to typical culture strings, e.g. fr-FR, de-DE, etc.

            // using System.Threading;
            // using System.Globalization;
            // using System.Configuration;
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(ConfigurationManager.AppSettings.Get("UICultureOverride"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading this introductory book on parsing (which is pretty good btw) and one
I'm reading the Rails AntiPatterns book, which I'm enjoying a lot. At one point,
I am reading one book which says Rather than setting the DialogResult by hand
I'm reading the book Spring Recipes right now, and am puzzled by one thing:
I am reading the book Think Python by Allen Downey. For chapter 4, one
All. I am reading a book called and one of the idea is Don't
If i am reading one of my application settings from the web.config everytime when
I am reading one file using ruby in which I have written regexp in
While reading one book named Cracking the coding interview by Gayle Laakmann , i
The example for one of the exercises in the book I am reading shows

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.