IW4M-Admin/Application/Localization/Configure.cs
RaidMax 5dfaa4ebd6 update projects to .NET Core 2.0.7
added instance and client count to api page
removed vestigial ConfigGenerator
2018-04-23 16:03:50 -05:00

36 lines
1.1 KiB
C#

using SharedLibraryCore;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace IW4MAdmin.Application.Localization
{
public class Configure
{
public static void Initialize()
{
string currentLocal = CultureInfo.CurrentCulture.Name;
#if DEBUG
// currentLocal = "ru-RU";
#endif
string localizationFile = $"Localization{Path.DirectorySeparatorChar}IW4MAdmin.{currentLocal}.json";
string localizationContents;
if (File.Exists(localizationFile))
{
localizationContents = File.ReadAllText(localizationFile, Encoding.UTF8);
}
else
{
localizationFile = $"Localization{Path.DirectorySeparatorChar}IW4MAdmin.en-US.json";
localizationContents = File.ReadAllText(localizationFile, Encoding.UTF8);
}
Utilities.CurrentLocalization = Newtonsoft.Json.JsonConvert.DeserializeObject<SharedLibraryCore.Localization.Layout>(localizationContents);
}
}
}