Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NeutralResourcesLanguage Usage

The verbiage below is from a generated AssemblyInfo file. Does this mean MS is recommending I modify the .csproj file by hand? By a Setting?

If it is by a Setting then what use is the NeutralResourcesLanguage attribute? How are you supposed to access it in code.

Cheers,
Berryl

//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)]
like image 833
Berryl Avatar asked Dec 15 '11 14:12

Berryl


2 Answers

This attribute (not a setting) can be defined in project properties, like so

  1. In Solution Explorer, right-click your project, and then Click Properties.
  2. From the left navigation bar select Application, and then click Assembly Information.
  3. In the Assembly Information dialog box, select the language from the Neutral Language drop-down list.
  4. Click OK.
like image 161
Berryl Avatar answered Oct 19 '22 15:10

Berryl


In .Net core projects you can specify it in csproj:

<PropertyGroup>
  <TargetFramework>netcoreapp3.0</TargetFramework>
  <NeutralLanguage>fr</NeutralLanguage>
</PropertyGroup>

or using Visual studio:

  1. In Solution Explorer, right-click your project, and then Click Properties.
  2. From the left navigation bar select Package
  3. Select value for Assembly neutral language
like image 7
AlbertK Avatar answered Oct 19 '22 13:10

AlbertK