fix language loading

This commit is contained in:
Jonathan Jenne
2022-11-07 16:42:14 +01:00
parent 8169bb5a7a
commit 360572dd29
10 changed files with 111 additions and 20 deletions

View File

@@ -26,13 +26,36 @@ Public Class frmMain
Public Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Dim splash As New frmSplash()
splash.ShowDialog()
Try
If USER_LANGUAGE <> "" Then
Dim cultureInfo As New System.Globalization.CultureInfo(USER_LANGUAGE)
cultureInfo.DateTimeFormat.ShortDatePattern = USER_DATE_FORMAT
Thread.CurrentThread.CurrentCulture = cultureInfo
Thread.CurrentThread.CurrentUICulture = cultureInfo
CultureInfo.DefaultThreadCurrentCulture = cultureInfo
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo
End If
Catch ex As Exception
Logger.Error(ex)
End Try
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
_DataASorDB = New ClassDataASorDB(modCurrent.LogConfig)
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
ClassWindowLocation.LoadFormLocationSize(Me)
If ERROR_INIT = "FAILED DBCONNECTION" Or ERROR_INIT = "DATABASE" Then
frmConfig_Basic.ShowDialog()
End If
lblUser.Caption = USER_USERNAME
If ERROR_INIT <> "INVALID USER" Then
'Dim Culture = CultureInfo.CreateSpecificCulture(USER_LANGUAGE)
@@ -52,16 +75,6 @@ Public Class frmMain
End If
_DataASorDB = New ClassDataASorDB(modCurrent.LogConfig)
End Sub
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
ClassWindowLocation.LoadFormLocationSize(Me)
If ERROR_INIT = "FAILED DBCONNECTION" Or ERROR_INIT = "DATABASE" Then
frmConfig_Basic.ShowDialog()
End If
lblUser.Caption = USER_USERNAME
If Database.DBInitialized = True Then
If ERROR_INIT <> "" Then
If ERROR_INIT = "NO CLIENT" Then
@@ -122,8 +135,8 @@ Public Class frmMain
RefreshUI()
Dim resources = New System.ComponentModel.ComponentResourceManager(Me.[GetType]())
GetChildren(Me).ToList().ForEach(Sub(c) resources.ApplyResources(c, c.Name))
'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)