How can i set default language of UWP app?

喜欢而已 提交于 2021-01-28 13:47:10

问题


I have 2 languages. en-US and ru-Ru

When i set Default Language to ru-RU i got the error:

PRI257: 0xdef00522 - Resources found for language(s) 'ru-ru,en-us' but no resources found for default language(s): 'ru-RU'. Change the default language or qualify resources with the default language.

What is wrong?


回答1:


I had the same issue: Resources found for language(s) 'nl-be,en-us' but no resources found for default language(s): 'nl-be,en-us'. So it complains about finding resources, it doesn't find. It may not be the result of the same root cause as OP's problem, but I want to share my fix, that's why I'll explain my search path of how I fixed it below. Maybe you can find a solution for your specific situation in any of these steps. To start: My project has as default language nl-BE in its appxmanifest.

My search led me to this page https://docs.microsoft.com/en-us/windows/uwp/app-resources/specify-default-resources-installed. After trying this, I discovered the warning didn't show up when I build as Release instead of Debug. In the article above, they mentioned <ProjectFolder>\obj\<ReleaseConfiguration folder>\priconfig.xml so I went there and took a look.

In this folder there are all these resource*.resfiles. I checked each one of them. I couldn't find any issues (they all contained resources for both languages (nl-BE and en-US)). That is, when I look in Release. However, when I looked in the Debug counterpart, I found a resources.en-us.resfiles file. There was no nl-be counterpart and it contained a single resource obj\x64\Debug\FxResources.System.Text.Json.SR.resw. As far as I know, these are resources for code analyzers (not something I actively added to my project) and there is no nl-be counterpart.

My project has as default language nl-BE in its appxmanifest. Setting <qualifier name="Language" value="nl-BE" /> in priconfig.default.xml of course still didn't fix the warning in Debug (there are no nl-BE FxResources), but changing the default language in the appxmanifest and priconfig.default.xml to en-US did fix the warnings in Debug. The resources.en-us.resfiles file doesn't appear anymore and the resource FxResources.System.Text.Json.SR.resw is added to the resources.resfile. After discovering all this, I reverted my project back to nl-BE and don't bother anymore with the warning.

TL;DR: It only happens because of the code analyzers, which are not included in Release.



来源:https://stackoverflow.com/questions/62360272/how-can-i-set-default-language-of-uwp-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!