private void OpenFolderToolStripMenuItem_Click(object sender, EventArgs e) { fbd.ShowDialog(); if (fbd.SelectedPath != "") { EditorBackend.LoadLanguages(fbd.SelectedPath); lb_localizations.Items.Clear(); foreach (KeyValuePair <string, LoCa.Language> lang in EditorBackend.Languages) { lb_localizations.Items.Add(lang.Key); } } }
private void cms_copy_Click(object sender, EventArgs e) { if (lb_localizations.SelectedItem == null) { return; } string old = (string)lb_localizations.SelectedItem; EditForm ef = new EditForm(false); ef.ShowDialog(); string ename = ef.editname; System.IO.File.Copy(System.IO.Path.Combine(EditorBackend.Directory, old), System.IO.Path.Combine(EditorBackend.Directory, ename)); lb_localizations.Items.Add(ename); EditorBackend.LoadLanguages(EditorBackend.Directory); }
private void cms_create_Click(object sender, EventArgs e) { EditForm ef = new EditForm(false); ef.ShowDialog(); string ename = ef.editname; lb_localizations.Items.Add(ename); using (System.IO.StreamWriter sw = new System.IO.StreamWriter(System.IO.Path.Combine(EditorBackend.Directory, ename))) { sw.WriteLine("language_key=change me"); sw.WriteLine("language_english=change me"); sw.WriteLine("language_local=change me"); sw.WriteLine("language_author=change me"); sw.WriteLine("language_version=change me"); } EditorBackend.LoadLanguages(EditorBackend.Directory); }
private void bt_save_Click(object sender, EventArgs e) { using (System.IO.StreamWriter sw = new System.IO.StreamWriter(System.IO.Path.Combine(EditorBackend.Directory, (string)lb_localizations.SelectedItem))) { sw.WriteLine("language_key=" + tb_key.Text); sw.WriteLine("language_english=" + tb_english.Text); sw.WriteLine("language_local=" + tb_local.Text); sw.WriteLine("language_author=" + tb_author.Text); sw.WriteLine("language_version=" + tb_version.Text); sw.WriteLine(""); foreach (DataGridViewRow row in dgv_trans.Rows) { if (row.Cells[0].Value != null && row.Cells[1].Value != null) { sw.WriteLine(row.Cells[0].Value + "=" + row.Cells[1].Value); } } } MessageBox.Show("Saved...", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); EditorBackend.LoadLanguages(EditorBackend.Directory); }