IW4M-Admin/Application/Localization/Configure.cs
RaidMax 02ef5a0bf8 adding IW5m parsers
reduce status polling rate
adding preliminary russian localization
small rcon tweak to attempt to send custom encoded messages
removed exception handling in ConvertLong
throttled servers will still attempt to execute events
2018-04-23 00:43:48 -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);
}
}
}