Skip to content

Commit

Permalink
Merge pull request #31 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed Jan 25, 2016
2 parents 9f72005 + ee7d257 commit ca2f040
Show file tree
Hide file tree
Showing 4 changed files with 618 additions and 397 deletions.
13 changes: 13 additions & 0 deletions instat/dlgOptions.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 80 additions & 53 deletions instat/dlgOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,82 +19,109 @@ Imports System.Threading
Imports instat.Translations

Public Class dlgOptions
Public StrComment As String
Public strComment As String = "code generated by the dialog"
Public strCurrLanguage As String


Private Sub dlgOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
End Sub
Private Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click
txtComment.Text = strComment
strCurrLanguage = Thread.CurrentThread.CurrentCulture.ThreeLetterISOLanguageName
rdoEnglish.Checked = False
rdoFrench.Checked = False
rdoKiswahili.Checked = False

Select Case strCurrLanguage
Case "eng"
rdoEnglish.Checked = True
Case "fra"
rdoFrench.Checked = True
Case "swa"
rdoKiswahili.Checked = True
End Select
cmdApply.Enabled = False
cmdOk.Enabled = False

End Sub
Private Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click
Me.Close()
End Sub

Private Sub cmdOk_Click(sender As Object, e As EventArgs) Handles cmdOk.Click
StrComment = txtComment.Text
If Not (rdoEnglish.Checked And rdoFrench.Checked And rdoFrench.Checked) Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US")
autoTranslate(frmMain)
autoTranslate(Me)
Me.Close()
cmdApply_Click(sender, e)
Me.Close()
End Sub

ElseIf rdoEnglish.Checked = True Then
Private Sub cmdApply_Click(sender As Object, e As EventArgs) Handles cmdApply.Click
strComment = txtComment.Text
If rdoEnglish.Checked Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US")
autoTranslate(frmMain)
autoTranslate(Me)
rdoEnglish.Checked = False
rdoFrench.Checked = False
rdoKiswahili.Checked = False
Me.Close()
strCurrLanguage = "eng"
End If

ElseIf rdoFrench.Checked = True Then
If rdoFrench.Checked Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("fr-FR")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("fr-FR")
autoTranslate(frmMain)
autoTranslate(Me)
rdoEnglish.Checked = False
rdoFrench.Checked = False
rdoKiswahili.Checked = False
Me.Close()
Else
strCurrLanguage = "fra"
End If

If rdoKiswahili.Checked Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("sw-KE")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("sw-KE")
strCurrLanguage = "swa"
End If
cmdApply.Enabled = False
cmdOk.Enabled = False
autoTranslate(Me)

If frmMain.Visible Then
autoTranslate(frmMain)
autoTranslate(Me)
rdoEnglish.Checked = False
rdoFrench.Checked = False
rdoKiswahili.Checked = False
Me.Close()
End If
End Sub

Private Sub cmdApply_Click(sender As Object, e As EventArgs) Handles cmdApply.Click
StrComment = txtComment.Text
If frmCommand.Visible Then
autoTranslate(frmCommand)
End If

If Not (rdoEnglish.Checked And rdoFrench.Checked And rdoFrench.Checked) Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US")
autoTranslate(frmMain)
autoTranslate(Me)
If frmEditor.Visible Then
autoTranslate(frmEditor)
End If

ElseIf rdoEnglish.Checked = True Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US")
autoTranslate(frmMain)
autoTranslate(Me)
ElseIf rdoFrench.Checked = True Then
Thread.CurrentThread.CurrentCulture = New CultureInfo("fr-FR")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("fr-FR")
autoTranslate(frmMain)
autoTranslate(Me)
Else
Thread.CurrentThread.CurrentCulture = New CultureInfo("sw-KE")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("sw-KE")
autoTranslate(frmMain)
autoTranslate(Me)
If frmLog.Visible Then
autoTranslate(frmLog)
End If

If frmMetaData.Visible Then
autoTranslate(frmMetaData)
End If

If frmScript.Visible Then
autoTranslate(frmScript)
End If

If frmVariables.Visible Then
autoTranslate(frmVariables)
End If
End Sub

Private Sub rdoKiswahili_CheckedChanged(sender As Object, e As EventArgs) Handles rdoKiswahili.CheckedChanged
cmdApply.Enabled = True
cmdOk.Enabled = True
End Sub

Private Sub rdoFrench_CheckedChanged(sender As Object, e As EventArgs) Handles rdoFrench.CheckedChanged
cmdApply.Enabled = True
cmdOk.Enabled = True
End Sub

Private Sub rdoEnglish_CheckedChanged(sender As Object, e As EventArgs) Handles rdoEnglish.CheckedChanged
cmdApply.Enabled = True
cmdOk.Enabled = True
End Sub

Private Sub txtComment_TextChanged(sender As Object, e As EventArgs) Handles txtComment.TextChanged
cmdApply.Enabled = True
cmdOk.Enabled = True
End Sub

End Class
Loading

0 comments on commit ca2f040

Please sign in to comment.