forked from meee1/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
L10N.cs
34 lines (31 loc) · 1.04 KB
/
L10N.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
using MissionPlanner.Properties;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using log4net;
using MissionPlanner.Utilities;
namespace MissionPlanner
{
public class L10N
{
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static CultureInfo ConfigLang;
static L10N()
{
ConfigLang = GetConfigLang();
Strings.Culture = ConfigLang;
//In .NET 4.5,System.Globalization.CultureInfo.DefaultThreadCurrentCulture & DefaultThreadCurrentUICulture is avaiable
}
public static CultureInfo GetConfigLang()
{
if (Settings.Instance["language"] == null)
return CultureInfo.CurrentUICulture;
else
return CultureInfoEx.GetCultureInfo(Settings.Instance["language"]);
}
}
}