public void Initialize() { if (!Directory.Exists(Folder)) { Directory.CreateDirectory(Folder); } foreach (var item in Directory.GetFiles(Folder)) { if (!CheckForUnprotectedTranslation(item) || !item.Contains(translationExtension)) { continue; } var fi = new FileInfo(item); LanguageList.Add(fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length)); } if (!LanguageList.Contains("English")) { var englishUi = new InterfaceTranslation { LanguageName = "English", Translation = GetTranslationTags(GetAllWindows()) }; if (_withEncryption) { englishUi.CryptData(Path.Combine(Folder, "English" + _fileExtension), _entropy); } else { englishUi.SerializeDataJson(Path.Combine(Folder, "English" + _fileExtension)); } LanguageList.Add("English"); } #if DEBUG CurrentTranslationLanguage = "EMPTY"; #endif }
private void SaveCurrent() { var langPath = Path.Combine(Folder, CurrentTranslationLanguage + ".json"); _alterTranslation.SerializeDataJson(langPath); }