bkaid
bkaid

Reputation: 52083

How do you get a list of installed display languages?

I know which languages the OS is available in from the MSDN documentation but I am looking for a way to retrieve this with code. InputLanguage.InstalledInputLanguages doesn't seem to be available and I can't find its equivalent.

Upvotes: 1

Views: 1364

Answers (2)

Ingerdev
Ingerdev

Reputation: 89

Solved this.

public bool isCultureSupported(String culture)
{ 
  CultureInfo locale = new CultureInfo(culture);
  if (locale.CompareInfo == null)
    return false;

  return true;

}

Upvotes: 0

Emond
Emond

Reputation: 50682

I am not aware of any API in Windows Phone that returns a list of installed/available languages. I did find out that switching to an unsupported CultureInfo on the current thread Current(UI)Culture throws an exception.

So it is possible to test a couple of cultures (I wouldn't test them all, but you could test for the languages you support) in an ugly way.

That said, I do think you should NOT (be able to) change the language in your program because it will confuse the user. The user will expect to change the language himself.

Upvotes: 2

Related Questions