问题
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*.resfile
s. 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