private void folderDToolStripMenuItem_Click(object sender, EventArgs e) { FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "ローカリゼーションフォルダを作成するフォルダを選択してください。"; if (dialog.ShowDialog() == DialogResult.OK) { _files.ForEach(el => el.Close()); _files.Clear(); _path = $"{dialog.SelectedPath}\\LocalizeFiles"; Directory.CreateDirectory(_path); _openedLocalizationManager = new LocalizationManager(_path, CultureInfo.CurrentCulture); JsonLocalizeFile file = new JsonLocalizeFile(CultureInfo.CurrentCulture); file.Save(_path); _openedLocalizationManager.LoadFile($"{_path}\\{CultureInfo.CurrentCulture.Name}.json_lang", ".json_lang"); foreach (ILocalizeFile localizeFile in _openedLocalizationManager.GetFiles()) { void LoadFunc() { LocalizeFileEditorPanel panel = new LocalizeFileEditorPanel(localizeFile); _files.Add(panel); panel.Show(dockPanel1, DockState.Document); } LoadFunc(); } } }
public void CreateFile() { Directory.CreateDirectory("LocalizeFiles"); JsonLocalizeFile file = new JsonLocalizeFile(new CultureInfo("ja-JP")) { { "testLocalize.text", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text2", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text3", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text4", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text5", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text6", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text7", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text8", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text9", new LocalizeTextContent("Hello LocalizationSharp!") }, { "testLocalize.text10", new LocalizeTextContent("Hello LocalizationSharp!") }, }; file.Save($"LocalizeFiles"); }