Docs / Preparing your WPF Project for Localization

Preparing your WPF Project for Localization

To prepare WPF project for localization, you need to follow these steps:

1. Specify development language for the projects

For every project you want to localize, open .csproj file and add the following line inside the <PropertyGroup>:

<UICulture>en-US</UICulture>

Open Properties/AssemblyInfo.cs file and add the following line:

[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]

If you development culture is not US english replace en-US with whatever your development culture is. Here is a list of available cultures to choose from.

2. Update Uid's in your XAML files

The best way to update Uid's is to use MSBuild tool.

Open command prompt with your Visual Studio paths set up and run the following command (substituting project.csproj with your project name):

msbuild /t:updateuid project.csproj

After this command completes, all elements in your XAML files will contain a Uid tag, which is used to identify every string you want to localize.

3. Rebuild your project

Now when you build your application, neutral language resources for your development language is generate in the /en-US/ (or culture you specified) folder of your output directory.

Now you are ready to use Visual LocBaml to localize your application.