forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
L10N.cs
27 lines (24 loc) · 879 Bytes
/
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
using log4net;
using MissionPlanner.Utilities;
using System.Globalization;
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"]);
}
}
}