Note that there are some explanatory texts on larger screens.

plurals
  1. POLocalisation in WPF
    primarykey
    data
    text
    <p>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: </p> <p>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. </p> <p>2)I did the same for fr-FR and created a backup for it. </p> <p>3)Next I placed both the created subfolders in the application folder with the names en-US and fr-FR. </p> <p>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.<br> 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. </p> <p>Can anyone clarify where am I doing/understanding wrong? </p> <p>Here are the words of the book:<br> Preparing an Application for Localization<br> 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:<br> en-US<br> 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).<br> This assembly contains all the compiled BAML resources for your application, which were previously stored in your main application assembly.<br> 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.<br> 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.<br> When the CLR begins probing for a satellite assembly, it follows a few simple rules of precedence:<br> 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).<br> 2. If it can’t find this directory, it looks for a satellite assembly that’s targeted for the current language (such as fr).<br> 3. If it can’t find this directory, an IOException exception is thrown. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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