Common: Save workspaces per language, fix resetting workspaces, set language on load

This commit is contained in:
Jonathan Jenne
2023-05-16 16:42:59 +02:00
parent b53e18d424
commit e77cfdb98b
6 changed files with 938 additions and 1300 deletions

View File

@@ -20,6 +20,7 @@ Namespace DocumentResultList
Public Const DEFAULT_WORKSPACE As String = "Default"
Private _CurrentWorkspace As String = Nothing
Private _UserLanguage As String = Nothing
Public Event WorkspaceLoaded As EventHandler(Of String)
@@ -37,8 +38,9 @@ Namespace DocumentResultList
End Get
End Property
Public Sub New(pLogConfig As LogConfig, pConfigManager As ConfigManager(Of TConfig), pWorkspaceManager As WorkspaceManager)
Public Sub New(pLogConfig As LogConfig, pConfigManager As ConfigManager(Of TConfig), pWorkspaceManager As WorkspaceManager, pUserLanguage As String)
MyBase.New(pLogConfig)
_UserLanguage = pUserLanguage
Manager = pWorkspaceManager
Config = pConfigManager
FileEx = New File(pLogConfig)
@@ -61,7 +63,7 @@ Namespace DocumentResultList
Private Function GetWorkspacePath(pWorkspaceName As String) As String
Dim oDirectory = GetWorkspaceDirectoryPath()
Dim oFilename As String = Utils.ConvertTextToSlug(pWorkspaceName) & ".xml"
Dim oFilename As String = Utils.ConvertTextToSlug(pWorkspaceName) & "_" & _UserLanguage & ".xml"
Return IO.Path.Combine(oDirectory, oFilename)
End Function