#1,131 – Localization XII – Set NeutralLanguageResources Attribute

When you set the UICulture tag in your project, signifying that you want to store resources in a satellite assembly, you also need to set the NeutralResourcesLanguage attribute to indicate the default language to be used when trying to load resources to match the current culture.

Below is a fragment from AssemblyInfo.cs, showing use of the NeutralResourcesLanguage attribute, as well as the comments provided by the New Project wizard.

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>.  For example, if you are using US english
//in your source files, set the <UICulture> to en-US.  Then uncomment
//the NeutralResourceLanguage attribute below.  Update the "en-US" in
//the line below to match the UICulture setting in the project file.
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #1,131 – Localization XII – Set NeutralLanguageResources Attribute

  1. Pingback: Dew Drop – August 7, 2014 (#1831) | Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: