【问题标题】:How to maintain language specific comments after TargetFramework changeTargetFramework 更改后如何维护特定于语言的注释
【发布时间】:2015-07-15 16:20:17
【问题描述】:

我将为我们的客户项目升级 TargetFramework,但他们使用法语进行开发。但是我们在这里使用英语。现在,当我升级目标框架时,资源设计器文件 cmets 从法语更改为英语。 资源设计器在框架 4.0 中文件 cmets

<summary>
///   Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
/// </summary>

使用项目属性升级 TargetFramework 后,下拉更改为

/// <summary>
///   A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>

您能帮我吗?我们如何才能将 Visual Studio 自动生成的 cmets 保存为法语,我需要采取哪些步骤来处理这个问题?

是否有可能,如果我在我的机器上安装法语和英语语言的 4.5.2 框架。那么当我当时从下拉列表中选择targetframwork时,我可以指定我需要迁移法语或英语的哪种语言?

这些是自定义资源文件,例如 EmployeeException.resx 文件。现在该文件的内容没有改变。它仍然是法语,但其设计器文件 MEGExceptionMessages.Designer.cs 已更改为英语翻译。由于这些是 Visual Studio 支持的文件,所以我认为它会由于框架更改而自动转换..

早点

<auto-generated>
//     Ce code a été généré par un outil.
//     Version du runtime :4.0.30319.18444
//
//     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
//     le code est régénéré.
// </auto-generated>

Target 框架更改后,现在是....

/ <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34209
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>

【问题讨论】:

  • 好吧,至少他们会学英语^^
  • 如果项目可以在.editorconfig 中指定首选的自动生成评论语言,那就太好了。但我不认为这样的事情存在(还没有?)。

标签: c# .net visual-studio-2012


【解决方案1】:

我从 MSDN 博客上得到了答案。您可以参考以下链接了解更多详情。为了解决这个问题,需要安装 Visual Studio 语言包,然后从工具>>选项>>国际设置中选择特定的语言设置。

https://social.msdn.microsoft.com/Forums/vstudio/en-US/cd7d0132-3d57-4fd7-ad42-35866c94af62/how-to-maintain-language-specific-comments-after-targetframework-change?forum=netfxbcl

安库什

【讨论】:

  • 这无济于事,因为问题恰恰相反:无论当前开发人员使用哪种语言版本的 VS,都不应触摸文本。每当具有不同 VS 版本的开发人员编辑文件时,所有 cmets 都会发生变化,这是相当讨厌的。
猜你喜欢
  • 2021-12-21
  • 1970-01-01
  • 1970-01-01
  • 2020-04-12
  • 1970-01-01
  • 1970-01-01
  • 2020-07-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多