使用UWP应用程序的资源文件的所有版本文化 [英] Use all culture versions of resources files in UWP app

查看:379
本文介绍了使用UWP应用程序的资源文件的所有版本文化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Accoding安迪·威格利此视频的 https://www.microsoftvirtualacademy.com/en-US/training-courses/a-developer-s-guide-to-windows-10-12618 (看看更多的资源 - >本地化),超纯水的应用程序只下载他们需要的文化资源。

Accoding to Andy Wigley on this video https://www.microsoftvirtualacademy.com/en-US/training-courses/a-developer-s-guide-to-windows-10-12618 (look in additional resources -> Localization), UPW apps download only the culture resources they need.

我在写一个使用资源文件不仅翻译界面也为用户生成文件的应用程序。用户可能希望产生在不同文化比OS使用所述一个文件。我怎样才能保证例如如果我的系统是在EN-US我将能够获得资源,法语吗?

I'm writing an app that uses resource files not only to translate UI but also generate files for the user. User may want to generate files in different culture than the one the OS uses. How I can assure that e.g. if my system is in en-US I will be able to get resources in french?

我可能会使用都将被包含在应用自己的XML文件。但一些肯定的资源也将需要用户界面,所以我不希望重复的资源,并有他们两次转换。

I may use own XML files that all will be included in the app. But some of the resource for sure will be needed also in UI, so I don't want to duplicate the resources and have to translate them twice.

推荐答案

罗布的答案将一个新的应用工作的伟大,但它并没有为我工作,因为我已经发运的应用程序的早期版本作为捆绑包。如果再尝试切换到非捆扎包装,商店提交门户网站给出了错误:

Rob's answer would work great for a new app, but it didn't work for me, as I had already shipped a previous version of the app as a bundled package. If you then try to switch to a non-bundled package, the store submission portal gives the error:

一个以前提交这个应用程序是与Windows 10 appxbundle释放。随后的参赛作品必须继续包含一个Windows 10 appxbundle。

A previous submission for this app was released with a Windows 10 appxbundle. Subsequent submissions must continue to contain a Windows 10 appxbundle.

在逆向工程太多构建系统,我发现了足够的线索发现这口井隐藏文档: https://msdn.microsoft.com/en -us /库/ dn482043.aspx

After reverse-engineering far too much of the build system, I found enough clues to discover this well-hidden documentation: https://msdn.microsoft.com/en-us/library/dn482043.aspx

以下的步骤有,你还是会创建一个捆绑包,但工具链不会使用的语言的作为限定在其上分离出不同的包。换言之,中性包将在其所有的语言,同时还捆绑卫星包的缩放的(或任何你喜欢)。

Following the steps there, you'll still create a bundled package, but the toolchain won't use Language as a qualifier on which to separate out different bundles. In other words, the neutral package will have all the languages in it, while still bundling satellite packages for Scale (or whatever you like).

万一MSDN页面消失,点睛之笔是,你可以覆盖< AppxBundleAutoResourcePackageQualifiers> 在你的MSBuild文件来删除语言特点预选赛:

In case the MSDN page vanishes, the punchline is that you can override <AppxBundleAutoResourcePackageQualifiers> in your msbuild file to remove the Langauge qualifier:

<AppxBundleAutoResourcePackageQualifiers>Scale</AppxBundleAutoResourcePackageQualifiers>

这篇关于使用UWP应用程序的资源文件的所有版本文化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆