UWP:对于语言资源文件是不正确部署 [英] UWP: Resource file for languages is not deployed correctly

查看:324
本文介绍了UWP:对于语言资源文件是不正确部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我的环球-Windows的应用程序:我给用户更改应用程序的语言选项。



有关这个提议,我通过了 X各自语言中的Ressources.resw文件和我的XAML代码referes创建:UID = 部分的资源。语言是通过 primaryLanguageOverride $改变B $ B此在我的环境是工作的罚款。但是,如果我部署在App Store->创建应用程序软件包,然后尝试侧向载荷的语言变化没有正确地反映在(不同的)Windows的10台机器的应用。例如日期 - 格式适当改变,但所指向的资源文件中的属性不正确地改变



但是:如果用户拥有相应的Windows语言-pack安装,应用程序工作正常。我的猜测是,Windows将检查哪些语言的资源文件将与安装的语言系统上部署:





我怎样才能避免这种情况?


解决方案

不过,如果我通过部署在Store-应用程序>创建应用程序包,然后尝试侧向载荷上(不同的)Windows的10台机器的应用程序的语言更改不会正确反映结果
但是:如果用户有相应的安装的Windows语言-包,应用程序工作正常。我的猜测是,Windows将
查看该语言的资源文件将与安装
语言的系统上部署:




我可以重现此问题,如果我已经设置了生成应用程序包总是如果需要在这种方式就像你说的,只有当用户有相应的Windows语言,包安装,然后应用程序将正常工作。



其原因,这是因为,如果我们设置了生成应用程序包总是如果需要后,它会创建的应用程序包。这意味着它会降低你的应用程序分为不同的部分来优化下载。仅是相关的设备的零件将被下载。例如,如果有不同的分辨率的资产,这将仅下载适合于该设备的人。 同样的事情的语言,它只会下载资源文件相关的设备的语言。所以,如果你试图改变语言,它就会失败还是回到属于相同的基本语言,因为别人都没有安装。所以,如果你没有相应的Windows-Language-Pack的安装,应用程序将不显示这是指向资源文件属性相关的语言。



有关更多信息,请尽量参照的这个博客




我怎样才能避免这种情况?




如果你想避免这种情况,解决方法是将生成应用程序包从不如下当在创建应用程序包和我在我的身边已经测试,它工作正常


I have a problem with my Universal-Windows-App: I'm giving the user the option to change the language of the app.

For this propose I've created for each language a "Ressources.resw" file and my XAML-code referes via the x:UID= part to the resources. The language is changed via primaryLanguageOverride This is working fine in my environment. However, if I deploy the app via Store->Create App Packages and then try to sideload the app on (different) Windows-10 machines the language change is not reflected correctly. For example the date-format is changing properly but the properties that are pointing to the resources file are not changing correctly.

But: If the user has the corresponding Windows-Language-Pack installed, the app is working fine. My guess is, that Windows will check which language-resource file it will deploy with the installed languages on the system:

How can I avoid this?

解决方案

However, if I deploy the app via Store->Create App Packages and then try to sideload the app on (different) Windows-10 machines the language change is not reflected correctly.
But: If the user has the corresponding Windows-Language-Pack installed, the app is working fine. My guess is, that Windows will check which language-resource file it will deploy with the installed languages on the system:

I can reproduce this behavior if I have set the "Generate App bundle" as "always" or "if needed", in this way as you said only if the user has the corresponding Windows-Language-Pack installed, then the app will work fine.

The reason for that it is because that if we have set the "Generate App bundle" as "always" or "if needed", it will create the app bundle. It means that it will cut your application into different parts to optimize the download. Only the parts that are relevant for the devices will be downloaded. For example, if there are the assets in different resolution, it will only download the ones that are suitable for the device. Same thing for languages, it will only download the resources file relevant to the language of the device. So if you try to change language, it will fail still fall back on the same base language, because others are not installed. So if you do not have the corresponding Windows-Language-Pack installed, the app will do not show the related language for that property which are pointing to the resources file.

For more information, please try to refer to this blog.

How can I avoid this?

If you want to avoid this, the workaround is to set the "Generate App bundle" as "never" as following when creating the app package and I have tested in my side, it works fine:

这篇关于UWP:对于语言资源文件是不正确部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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