0

I'm trying to localize my UWP app, and everything runs well while debugging in my pc, but when I create the app package, so I can install it on my windows tablet it works differently. Here is the problem. I have in my manifest 3 different languages declared like this:

  <Resources>
    <Resource Language="x-generate" />
    <Resource Language="pt-br" />
    <Resource Language="en-us" />
    <Resource Language="es-es" />
  </Resources>

In the app I try to get these languages so I can pick one to set on the app. I tried to get them using ApplicationLanguages.ManifestLanguages or ApplicationLanguages.Languages, none of them works. Yes I tried to remove the "x-generate" line, still nothing. I do have all the language packs installed on the tablet and it still doesn't show the languages.

Did anyone face this problem or something similar?

2 Answers2

1

I figured it out!

The thing here is the language packs installed in the user I was using. I have an admin user and another user without admin privileges, so when I installed my app package, I was logged in with my normal user but using admin privileges.

In my normal user I had all the language packs installed, but in my admin user I didn't.

So apparently, when running a script for the installation of the package, it finds the languages installed in the running account, and not in the logged account.

For some reason, that I still haven't figured out, the debugging in visual studio works differently.

0

Answer is simple. Do not try to get object itself:

 var l = ApplicationLanguages.Languages.ToList();
 var lm = ApplicationLanguages.ManifestLanguages.ToArray(); 
Alexej Sommer
  • 2,677
  • 1
  • 14
  • 25
  • Maybe I wasn't clear enough. Actually the languages don't show in the arrays. I'll explain better in my answer to this post. I found the problem. – Gustavo Z. H. Aug 08 '16 at 18:43