Last active
April 24, 2020 13:42
-
-
Save ashour/ee0ea47b36b49dcf239660ce66c1bab1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Globalization; | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
// Will print the current culture, which | |
// depends on your system settings | |
Console.WriteLine(Thread.CurrentThread.CurrentCulture); | |
// Will print the current UI culture, which | |
// depends on your system settings | |
Console.WriteLine(Thread.CurrentThread.CurrentUICulture); | |
var french = new CultureInfo("fr"); | |
Thread.CurrentThread.CurrentCulture = french; | |
Thread.CurrentThread.CurrentUICulture = french; | |
// Will print "fr" | |
Console.WriteLine(Thread.CurrentThread.CurrentCulture); | |
// Will print "fr" | |
Console.WriteLine(Thread.CurrentThread.CurrentUICulture); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment