如何限制构建仅支持 EN“Microsoft.Expression.Interactions.resources.dll”,并避免 DE、KR、FR、ES 等...?

发布于 2024-12-20 01:44:27 字数 174 浏览 3 评论 0 原文

当我构建 WPF 项目时,它会创建多个语言文件夹,每个文件夹都包含“Microsoft.Expression.Interactions.resources.dll”。

奇怪的是,我从未将资源字符串翻译为其他语言,但它仍然创建 DE、KR、FR、ES 文件夹。我只需要EN。

如何将本地化限制为仅 EN?

When I build my WPF Project, it creates several language folders, each containing "Microsoft.Expression.Interactions.resources.dll".

The weird thing is that I never created translations of my resource strings to other languages, and yet it still creates DE, KR, FR, ES folders. What I just need is EN.

How can I limit the localization to just EN?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

浮生面具三千个 2024-12-27 01:44:27

您看到这些文件是因为您正在使用 Blend SDK for .NET(直接或通过 Prism 库)。该 SDK 包含本地化资源,因此它们会包含在您的构建输出中。

以下是创建针对特定目标的 Silverlight 版本的方法文化。 对于 WPF,它应该以相同的方式工作。其要点是:

  1. 在您的解决方案中进行新的配置。
  2. 编辑每个项目文件以将 SupportedCulture 指定为“en”(注意大小写)。

如果您的解决方案非常大,这可能需要大量工作。老实说,在 WPF 应用程序中添加这些附加文件并没有什么坏处——它们只是占用了更多的磁盘空间。您也可以仅存档和发送 en 文化资源。假设您已定义 NeutralResourcesLanguage 因为您的应用程序将始终能够找到其资源(它们只是英文)。

You're seeing those files because you're using the Blend SDK for .NET (either directly or through the Prism library). That SDK includes localized resources thus they get included in your build output.

Here's how you create a Silverlight build that targets a specific culture. It should work the same way for WPF. The jist of it is:

  1. Make a new configuration in your solution.
  2. Edit each project file to specify the SupportedCulture as "en" (note the casing).

If your solution is quite large this could be a lot of work. Honestly it doesn't harm anything to have this additional files in a WPF application -- they simply take up a little more disk space. You could also only archive and ship the en culture resources. Assuming you've defined your NeutralResourcesLanguage as en your the application will always be able to find its resources (they'll just be in English).

@Mike-Post 解决方案对我不起作用:( 也许是因为 VS2012。
我添加了 en 但没有任何变化,并且还出现警告,指出它是无效元素。

但这里有另一个解决方案:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/feb23879-660d-43d1-93ef-90a63eef70c6/how-can-i-remove-localization-information-from- my-wpf-project

只需从 Program Files (x86)\Microsoft 中删除这些文件夹(可能除了 en) SDKs\Expression\Blend\.NETFramework\v4.0\Libraries

@Mike-Post solution didn't work for me :( Maybe because VS2012.
I added <SupportedCultures>en</SupportedCultures> but nothing changed and also there was a warning that it is invalid element.

But here is another solution:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/feb23879-660d-43d1-93ef-90a63eef70c6/how-can-i-remove-localization-information-from-my-wpf-project

just delete these folders (except en maybe) from Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries

怀中猫帐中妖 2024-12-27 01:44:27

我就这样处理。转到引用的属性并执行以下操作:

设置“Copy local = false”

保存

设置“Copy local = true”

保存

即可。

Visual Studio 2010 最初不会在引用标记中放置:True,并将“copy local”设置为 false 会导致它创建标记。然后它会相应地将其设置为 true 和 false。

I just deal with it like this. Go to the properties of your reference and do this:

Set "Copy local = false"

Save

Set "Copy local = true"

Save

and that's it.

Visual Studio 2010 doesn't initially put: True in the reference tag and setting "copy local" to false causes it to create the tag. Afterwards it will set it to true and false accordingly.

挽心 2024-12-27 01:44:27

我对输出文件夹中不需要的本地化文件夹和 resources.dll 文件也有同样的烦恼。删除对 Microsoft.Expression.Drawing 的引用解决了这个问题。

当然,这意味着我不能使用该库中的任何内容;我在 XAML 文件中使用 来绘制圆弧。我刚刚找到了一种不同的方法来绘制弧线。

I had this same irritation of unneeded localized folders and resources.dll files in the Output folder. Removing the reference to Microsoft.Expression.Drawing solved it.

Of course, this meant that I cannot use anything in that library; I was using <draw:Arc> in a XAML file to draw an arc. I just found a different way to draw the arc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文