comparison FrmPreferences.cs @ 96:b4416ca69153

Fixes #309: Add initial preference dialog with language support * Hook up events so that everything translates itself when languages change Re #308: Make GTK# UI translatable * Update English and French translations (using Google Translate) * Begin to standardise on WinForms names for widgets for maximum reusability of translation files * Make some preference and credit buttons translatable
author IBBoard <dev@ibboard.co.uk>
date Sun, 02 Jan 2011 15:12:31 +0000
parents ea4069bbe6e9
children
comparison
equal deleted inserted replaced
95:ea4069bbe6e9 96:b4416ca69153
24 prefs = preferences; 24 prefs = preferences;
25 initialLang = Translation.GetTranslationLanguage(); 25 initialLang = Translation.GetTranslationLanguage();
26 this.Build(); 26 this.Build();
27 BuildPreferenceCategoryTree(); 27 BuildPreferenceCategoryTree();
28 BuildLanguageList(); 28 BuildLanguageList();
29
30 Translation.TranslationChanged += Retranslate;
29 Translate(); 31 Translate();
32 }
33
34 private void Retranslate()
35 {
36 Translate();
37 }
38
39 public override void Dispose()
40 {
41 Translation.TranslationChanged -= Retranslate;
42 base.Dispose();
30 } 43 }
31 44
32 protected override void Translate() 45 protected override void Translate()
33 { 46 {
34 base.Translate(); 47 base.Translate();
35 frameLabel.Text = Translation.GetTranslation("languagesGroup", "languages"); 48 frameLabel.Text = Translation.GetTranslation("languagesGroup", "languages");
36 49 TreeStore model = ((TreeStore)preferencesTree.Model);
50 TreeIter iter;
51 model.GetIterFirst(out iter);
52 model.SetValue(iter, 0, Translation.GetTranslation("languagePrefSection", "Language"));
37 } 53 }
38 54
39 private void RenderPreference(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) 55 private void RenderPreference(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
40 { 56 {
41 object obj = model.GetValue(iter, 0); 57 object obj = model.GetValue(iter, 0);