Fix languages

This commit is contained in:
Jonathan Jenne
2022-11-07 15:42:02 +01:00
parent 84ff2c31f5
commit 8cdaa16c82
10 changed files with 5540 additions and 5195 deletions

View File

@@ -32,20 +32,26 @@ Public Class frmMain
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Dim splash As New frmSplash()
splash.ShowDialog()
If ERROR_INIT <> "INVALID USER" Then
Dim Culture = CultureInfo.CreateSpecificCulture(USER_LANGUAGE)
' The following line provides localization for the application's user interface.
Thread.CurrentThread.CurrentUICulture = Culture
If ERROR_INIT <> "INVALID USER" Then
'Dim Culture = CultureInfo.CreateSpecificCulture(USER_LANGUAGE)
Dim Culture As New CultureInfo(USER_LANGUAGE)
Culture.DateTimeFormat.ShortDatePattern = USER_DATE_FORMAT
' The following line provides localization for data formats.
Thread.CurrentThread.CurrentCulture = Culture
Thread.CurrentThread.CurrentUICulture = New CultureInfo(USER_LANGUAGE)
' The following line provides localization for the application's user interface.
Thread.CurrentThread.CurrentUICulture = Culture
' Set this culture as the default culture for all threads in this application.
' Note: The following properties are supported in the .NET Framework 4.5+
CultureInfo.DefaultThreadCurrentCulture = Culture
CultureInfo.DefaultThreadCurrentUICulture = Culture
Culture.DateTimeFormat.ShortDatePattern = USER_DATE_FORMAT
End If
_DataASorDB = New ClassDataASorDB(modCurrent.LogConfig)
End Sub
@@ -56,7 +62,6 @@ Public Class frmMain
End If
lblUser.Caption = USER_USERNAME
If Database.DBInitialized = True Then
If ERROR_INIT <> "" Then
If ERROR_INIT = "NO CLIENT" Then
@@ -116,8 +121,16 @@ Public Class frmMain
End If
RefreshUI()
Dim resources = New System.ComponentModel.ComponentResourceManager(Me.[GetType]())
GetChildren(Me).ToList().ForEach(Sub(c) resources.ApplyResources(c, c.Name))
End Sub
Private Function GetChildren(pControl As Control) As IEnumerable(Of Control)
Dim oControls = pControl.Controls.Cast(Of Control)()
Return oControls.SelectMany(Of Control)(Function(ctrl) GetChildren(ctrl)).Concat(oControls)
End Function
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Logger.Info(">> Logout time: " & Now.ToString, False)
If ERROR_INIT = "INVALID USER" Or ERROR_INIT = "NO CLIENT" Then
@@ -483,4 +496,8 @@ Public Class frmMain
Private Sub bbtniKonfig_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniKonfig.ItemClick
frmConfig_Basic.ShowDialog()
End Sub
Private Sub lblUser_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles lblUser.ItemClick
frmLanguage.Show()
End Sub
End Class