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

时间:2022-10-05 18:30:36

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

当我构建我的WPF项目时,它会创建几个语言文件夹,每个文件夹包含“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.

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

How can I limit the localization to just EN?

如何将本地化限制为EN?

3 个解决方案

#1


2  

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.

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

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:

以下是创建针对特定文化的Silverlight构建的方法。它应该以相同的方式用于WPF。它的主旨是:

  1. Make a new configuration in your solution.
  2. 在解决方案中进行新配置。
  3. Edit each project file to specify the SupportedCulture as "en" (note the casing).
  4. 编辑每个项目文件以将SupportedCulture指定为“en”(注意大小写)。

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).

如果您的解决方案非常庞大,那么这可能需要做很多工作。老实说,在WPF应用程序中拥有这些附加文件并不会造成任何损害 - 它们只占用更多的磁盘空间。您也可以只归档和发送文化资源。假设您已将NeutralResourcesLanguage定义为您的应用程序将始终能够找到其资源(它们将只是英文)。

#2


1  

@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.

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

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

但这是另一种解决方案:http://social.msdn.microsoft.com/Forums/vstudio/en-US/feb23879-660d-43d1-93ef-90a63eef70c6/how-can-i-remove-localization-information-from-我-WPF项目

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

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

#3


-1  

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.

我对Output文件夹中不需要的本地化文件夹和resources.dll文件有同样的不满。删除对Microsoft.Expression.Drawing的引用解决了它。

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.

当然,这意味着我不能在该库中使用任何东西;我在XAML文件中使用 来绘制弧。我刚刚发现了一种绘制弧线的不同方法。 :arc>

#1


2  

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.

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

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:

以下是创建针对特定文化的Silverlight构建的方法。它应该以相同的方式用于WPF。它的主旨是:

  1. Make a new configuration in your solution.
  2. 在解决方案中进行新配置。
  3. Edit each project file to specify the SupportedCulture as "en" (note the casing).
  4. 编辑每个项目文件以将SupportedCulture指定为“en”(注意大小写)。

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).

如果您的解决方案非常庞大,那么这可能需要做很多工作。老实说,在WPF应用程序中拥有这些附加文件并不会造成任何损害 - 它们只占用更多的磁盘空间。您也可以只归档和发送文化资源。假设您已将NeutralResourcesLanguage定义为您的应用程序将始终能够找到其资源(它们将只是英文)。

#2


1  

@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.

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

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

但这是另一种解决方案:http://social.msdn.microsoft.com/Forums/vstudio/en-US/feb23879-660d-43d1-93ef-90a63eef70c6/how-can-i-remove-localization-information-from-我-WPF项目

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

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

#3


-1  

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.

我对Output文件夹中不需要的本地化文件夹和resources.dll文件有同样的不满。删除对Microsoft.Expression.Drawing的引用解决了它。

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.

当然,这意味着我不能在该库中使用任何东西;我在XAML文件中使用 来绘制弧。我刚刚发现了一种绘制弧线的不同方法。 :arc>