Final touches on translation window.

This commit is contained in:
Tim Young 2017-10-03 17:54:41 -05:00
parent 240671304c
commit 22996529f5
3 changed files with 22 additions and 7 deletions

View File

@ -862,7 +862,7 @@
<comment>NB_NBEn = English</comment> <comment>NB_NBEn = English</comment>
</data> </data>
<data name="NB_NBFr" xml:space="preserve"> <data name="NB_NBFr" xml:space="preserve">
<value>français</value> <value>Français</value>
<comment>NB_NBFr = French</comment> <comment>NB_NBFr = French</comment>
</data> </data>
<data name="NB_RdCtxtHelp" xml:space="preserve"> <data name="NB_RdCtxtHelp" xml:space="preserve">
@ -1866,7 +1866,7 @@
<comment>PPF_UserDirectory</comment> <comment>PPF_UserDirectory</comment>
</data> </data>
<data name="_Save" xml:space="preserve"> <data name="_Save" xml:space="preserve">
<value>Save</value> <value>Enregistrer</value>
<comment>_Save = Save</comment> <comment>_Save = Save</comment>
</data> </data>
<data name="PC_HWFileImportStats" xml:space="preserve"> <data name="PC_HWFileImportStats" xml:space="preserve">
@ -1961,4 +1961,8 @@
<value>Network</value> <value>Network</value>
<comment>RPC_Network = Network</comment> <comment>RPC_Network = Network</comment>
</data> </data>
<data name="TW_Translate" xml:space="preserve">
<value>Translate</value>
<comment>TW_Translate = Translate</comment>
</data>
</root> </root>

View File

@ -1961,4 +1961,8 @@
<value>Network</value> <value>Network</value>
<comment>RPC_Network = Network</comment> <comment>RPC_Network = Network</comment>
</data> </data>
<data name="TW_Translate" xml:space="preserve">
<value>Translate</value>
<comment>TW_Translate = Translate</comment>
</data>
</root> </root>

View File

@ -14,6 +14,8 @@ namespace EduNetworkBuilder
public partial class TranslationWindow : Form public partial class TranslationWindow : Form
{ {
Network myNet = null; Network myNet = null;
string[,] LanguageChoices = { { NB.Translate("NB_NBEn"), "en" }, { NB.Translate("NB_NBFr"), "fr" } };
public TranslationWindow(Network ToEdit) public TranslationWindow(Network ToEdit)
{ {
InitializeComponent(); InitializeComponent();
@ -25,7 +27,6 @@ namespace EduNetworkBuilder
void LocalSetup() void LocalSetup()
{ {
string[,] LanguageChoices = NB.LanguageChoices;
cb1Language.Items.Clear(); cb1Language.Items.Clear();
cb2Language.Items.Clear(); cb2Language.Items.Clear();
NBSettings mySettings = NB.GetSettings(); NBSettings mySettings = NB.GetSettings();
@ -46,11 +47,18 @@ namespace EduNetworkBuilder
if (cb2Language.SelectedIndex == -1) cb2Language.SelectedIndex = 0; if (cb2Language.SelectedIndex == -1) cb2Language.SelectedIndex = 0;
Icon = Properties.Resources.NBIco; Icon = Properties.Resources.NBIco;
lblStatus.Text = ""; lblStatus.Text = "";
LanguagifyComponents();
}
private void LanguagifyComponents()
{
Text = NB.Translate("Translate");
btnSave.Text = NB.Translate("_Save");
btnClose.Text = NB.Translate("_Done");
} }
private void ClosingStuff() private void ClosingStuff()
{ {
string[,] LanguageChoices = NB.LanguageChoices;
NBSettings mySettings = NB.GetSettings(); NBSettings mySettings = NB.GetSettings();
for (int i = 0; i < LanguageChoices.GetLength(0); i++) for (int i = 0; i < LanguageChoices.GetLength(0); i++)
{ {
@ -68,7 +76,6 @@ namespace EduNetworkBuilder
string CodeFromLang(string language) string CodeFromLang(string language)
{ {
string[,] LanguageChoices = NB.LanguageChoices;
for (int i = 0; i < LanguageChoices.GetLength(0); i++) for (int i = 0; i < LanguageChoices.GetLength(0); i++)
{ {
if (language == LanguageChoices[i, 0]) return LanguageChoices[i, 1]; if (language == LanguageChoices[i, 0]) return LanguageChoices[i, 1];
@ -78,13 +85,13 @@ namespace EduNetworkBuilder
string LangFromCode(string Code) string LangFromCode(string Code)
{ {
string[,] LanguageChoices = NB.LanguageChoices;
for (int i = 0; i < LanguageChoices.GetLength(0); i++) for (int i = 0; i < LanguageChoices.GetLength(0); i++)
{ {
if (Code == LanguageChoices[i, 1]) return LanguageChoices[i, 0]; if (Code == LanguageChoices[i, 1]) return LanguageChoices[i, 0];
} }
return ""; return "";
} }
private void btnClose_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e)
{ {
Close(); Close();