0

I am trying to get language from kernel32.dll with GetNativeSystemInfo function as:

[DllImport("kernel32.dll")]
static extern void GetNativeSystemInfo(ref _SYSTEM_INFO lpSystemInfo);

This function returns me a Languege Id (in my case 1033). how can I parse it in order to get a string representation of that language code?

I've tried to follow those links, but I got lost:

function doc https://msdn.microsoft.com/en-us/library/windows/desktop/dd318123(v=vs.85).aspx

lang code doc https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/dd373763(v=vs.85).aspx

Pavel Durov
  • 1,287
  • 2
  • 13
  • 28
  • read this http://stackoverflow.com/questions/5710127/get-operating-system-language-in-c-sharp – prizm1 Nov 17 '15 at 14:34

1 Answers1

2

You can use these :

int langId = 1033 ; 

Console.WriteLine(CultureInfo.GetCultureInfo(langId).Name); // en-US
Console.WriteLine(CultureInfo.GetCultureInfo(langId).DisplayName); // English (United States)
Perfect28
  • 11,089
  • 3
  • 25
  • 45