예제 #1
0
        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>();
        }
예제 #2
0
        public Localizer()
        {
            _gameCultures =
                typeof(GameCulture).GetFieldDirectly(null, "_legacyCultures") as Dictionary <int, GameCulture>;

            Kernel = new LocalizerKernel();
            Kernel.Bind <RefreshLanguageService>().To <RefreshLanguageService>().InSingletonScope();
            Kernel.Get <RefreshLanguageService>();
        }