NeutralResourcesLanguage用法

问题描述 投票:5回答:2

下面的语言来自生成的AssemblyInfo文件。这是否表示MS建议我手动修改.csproj文件?通过设置?

如果是通过设置,那么NeutralResourcesLanguage属性有什么用?您应该如何通过代码访问它。

干杯,贝里

//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)]
.net wpf visual-studio silverlight resources
2个回答
9
投票

可以像这样在项目属性中定义此属性(不是设置)

  1. 在解决方案资源管理器中,右键单击您的项目,然后单击属性。
  2. 从左侧导航栏中选择应用程序,然后单击程序集信息。
  3. 在“装配体信息”对话框中,从“中性语言”下拉列表中选择语言。
  4. 单击确定。

0
投票

。Net core项​​目中,您可以在csproj中指定它:

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

或使用Visual studio

  1. 在解决方案资源管理器中,右键单击您的项目,然后单击Properties
  2. 从左侧导航栏中选择Package
  3. 选择Assembly neutral language的值
© www.soinside.com 2019 - 2024. All rights reserved.