-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
37 lines (30 loc) · 1.9 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
IEnumerable<CultureInfo> supported_cultures = Resource.ResourceManager.SupportedCultures();
Console.WriteLine("Supported Cultures using Resource Manager");
foreach (CultureInfo culture in supported_cultures)
{
Console.WriteLine($"> {culture.EnglishName}");
}
Console.WriteLine(" ==================== ");
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-GB");
Console.WriteLine($"CurrentThread.CurrentUICulture: {Thread.CurrentThread.CurrentUICulture.Name}");
Console.WriteLine($"Direct Test Value for Culture: {Resource.Test}");
Console.WriteLine(" -------------------- ");
string name_of_property = "Test";
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("es-ES");
Console.WriteLine($"CurrentThread.CurrentUICulture: {Thread.CurrentThread.CurrentUICulture.Name}");
Console.WriteLine($"Direct Test Value for Culture: {Resource.ResourceManager.GetString(name_of_property)}");
Console.WriteLine(" -------------------- ");
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("de-DE");
Console.WriteLine($"CurrentThread.CurrentUICulture: {Thread.CurrentThread.CurrentUICulture.Name}");
Console.WriteLine($"Direct Test Value for Culture: {Resource.Test}");
Console.WriteLine(" -------------------- ");
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");
Console.WriteLine($"CurrentThread.CurrentUICulture: {Thread.CurrentThread.CurrentUICulture.Name}");
Console.WriteLine($"Direct Test Value for Culture: {Resource.Test}");
Console.WriteLine(" -------------------- ");
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("es-MX");
Console.WriteLine($"CurrentThread.CurrentUICulture: {Thread.CurrentThread.CurrentUICulture.Name}");
Console.WriteLine($"Direct Test Value for Culture: {Resource.Test}");
Console.WriteLine(" -------------------- ");
Console.ReadLine();