【问题标题】:NeutralResourcesLanguage Usage中性资源语言使用
【发布时间】:2012-01-21 06:19:46
【问题描述】:

下面的措辞来自生成的 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


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢,但是 VS Express 没有添加 ,UltimateResourceFallbackLocation.Satellite。所以你必须打开 AssemblyInfo.cs 并手动添加突出显示的文本
    【解决方案2】:

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

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

    或使用Visual studio:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多