C # Change the system language

It is necessary to change the locale of the system to another country, I tried SystemParametersInfo (), GetKeyboardLayout (), which did not help.

How to change the system locale in C # for a console application?

+6
source share
2 answers

You can use SetLocalInfo .

[DllImport("kernel32.dll")] static extern bool SetLocaleInfo(uint Locale, uint LCType, string lpLCData); 
+2
source

eg.

  Thread.CurrentThread.CurrentCulture = new CultureInfo("es-AR"); // Espanol - Argentina Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-AR");// Espanol - Argentina 

eg,

  Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); // English - US Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");// English - US 
+2
source

Source: https://habr.com/ru/post/894184/


All Articles