private void LangToolStrip_Click(object sender, EventArgs e) { string langName = ((ToolStripMenuItem)sender).Text; string newLang = DefaultLanguage.Replace("Default", langName); ini = new INIClass(newLang); fileToolStripMenuItem.Text = GetValue("Menu", "File"); newToolStripMenuItem.Text = GetValue("Menu", "New"); openToolStripMenuItem.Text = GetValue("Menu", "Open"); saveToolStripMenuItem.Text = GetValue("Menu", "Save"); saveAsToolStripMenuItem.Text = GetValue("Menu", "Save As"); exitToolStripMenuItem.Text = GetValue("Menu", "Exit"); editToolStripMenuItem.Text = GetValue("Menu", "Edit"); undoToolStripMenuItem.Text = GetValue("Menu", "Undo"); redoToolStripMenuItem.Text = GetValue("Menu", "Redo"); cutToolStripMenuItem.Text = GetValue("Menu", "Cut"); copyToolStripMenuItem.Text = GetValue("Menu", "Copy"); pasteToolStripMenuItem.Text = GetValue("Menu", "Paste"); selectAllToolStripMenuItem.Text = GetValue("Menu", "Select All"); formatToolStripMenuItem.Text = GetValue("Menu", "Format"); fontToolStripMenuItem.Text = GetValue("Menu", "Font"); helpToolStripMenuItem.Text = GetValue("Menu", "Help"); languageToolStripMenuItem.Text = GetValue("Menu", "Language"); aboutToolStripMenuItem.Text = GetValue("Menu", "About"); toolStripMenuItem1.Text = GetValue("Context", "Cut"); toolStripMenuItem2.Text = GetValue("Context", "Copy"); toolStripMenuItem3.Text = GetValue("Context", "Paste"); }
public Form1() { ini = new INIClass(DefaultLanguage); InitializeComponent(); DirectoryInfo LanguagesDir = new DirectoryInfo("Language"); if (LanguagesDir.Exists) { foreach (FileInfo Lang in LanguagesDir.GetFiles("*.ini")) { try { LangToolStrip = new ToolStripMenuItem { Text = System.IO.Path.GetFileNameWithoutExtension(Lang.FullName), Image = Image.FromFile(Application.StartupPath + "\\Language\\LangIcons\\" + System.IO.Path.GetFileNameWithoutExtension(Lang.FullName) + ".Png") }; languageToolStripMenuItem.DropDownItems.Add(LangToolStrip); LangToolStrip.Click += LangToolStrip_Click; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } } }