private static void Init() { _gameCultures = typeof(GameCulture).ValueOf <Dictionary <int, GameCulture> >("_legacyCultures"); ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; SavePath = "./Localizer/"; SourcePackageDirPath = SavePath + "/Source/"; DownloadPackageDirPath = SavePath + "/Download/"; ConfigPath = SavePath + "/Config.json"; Utils.EnsureDir(SavePath); Utils.EnsureDir(SourcePackageDirPath); Utils.EnsureDir(DownloadPackageDirPath); LoadConfig(); AddModTranslations(Instance); Kernel = new LocalizerKernel(); Kernel.Init(); ModBrowser.Patches.Patch(); var autoImportService = Kernel.Get <AutoImportService>(); }
public override void Load() { PluginManager.Init(); Log = Logger; Instance = this; SavePath = "./Localizer/"; SourcePackageDirPath = SavePath + "/Source/"; DownloadPackageDirPath = SavePath + "/Download/"; ConfigPath = SavePath + "/Config.json"; Utils.CreateDirectory(SavePath); Utils.CreateDirectory(SourcePackageDirPath); Utils.CreateDirectory(DownloadPackageDirPath); LoadConfig(); Kernel = new LocalizerKernel(); Kernel.Load(new NinjectModule[] { new DefaultPackageModule(), new DefaultFileExportModule(), new DefaultFileUpdateModule(), new DefaultFileImportModule(), new DefaultNetworkModule(), }); }
public Localizer() { _gameCultures = typeof(GameCulture).GetFieldDirectly(null, "_legacyCultures") as Dictionary <int, GameCulture>; Kernel = new LocalizerKernel(); Kernel.Bind <RefreshLanguageService>().To <RefreshLanguageService>().InSingletonScope(); Kernel.Get <RefreshLanguageService>(); }
public abstract void Initialize(LocalizerKernel kernel);