Skip to content

Commit

Permalink
Update PR with translation fixes and adaptations to accomodate names.…
Browse files Browse the repository at this point in the history
… remove use of vbCrLf and convert to vbNewLine.
  • Loading branch information
hecon5 committed Jan 28, 2025
1 parent 1b2af32 commit 631f57e
Showing 1 changed file with 43 additions and 40 deletions.
83 changes: 43 additions & 40 deletions Version Control.accda.src/modules/modImportExport.bas
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Public Sub ExportSource(blnFullExport As Boolean, Optional intFilter As eContain
Log.Flush
If MsgBox2(T("Newer VCS Version Detected"), _
T("This project uses VCS version {0}, but version {1} is currently installed." & _
vbCrLf & "Would you like to continue anyway?", _
vbNewLine & "Would you like to continue anyway?", _
var0:=Options.GetLoadedVersion, var1:=GetVCSVersion), _
T("Click YES to continue this operation, or NO to cancel."), _
vbExclamation + vbYesNo + vbDefaultButton2) <> vbYes Then
Expand Down Expand Up @@ -264,7 +264,7 @@ CleanUp:
' Add performance data to log file and save file
Perf.EndTiming
With Log
.Add vbCrLf & Perf.GetReports, False
.Add vbNewLine & Perf.GetReports, False
.SaveFile
.Active = False
.Flush
Expand Down Expand Up @@ -408,7 +408,7 @@ CleanUp:
' Add performance data to log file and save file
Perf.EndTiming
With Log
.Add vbCrLf & Perf.GetReports, False
.Add vbNewLine & Perf.GetReports, False
.SaveFile
.Active = False
.Flush
Expand Down Expand Up @@ -605,7 +605,7 @@ CleanUp:
' Add performance data to log file and save file
Perf.EndTiming
With Log
.Add vbCrLf & Perf.GetReports, False
.Add vbNewLine & Perf.GetReports, False
.SaveFile
.Active = False
.Flush
Expand Down Expand Up @@ -725,7 +725,8 @@ Public Sub Build(strSourceFolder As String _

' Make sure we can find the source files
If Not FolderHasVcsOptionsFile(strSourceFolder) Then
MsgBox2 T("Source files not found"), T("Required source files were not found in the following folder:"), strSourceFolder, vbExclamation
MsgBox2 T("Source files not found") _
, T("Required source files were not found in the following folder:"), strSourceFolder, vbExclamation
GoTo CleanUp
End If

Expand All @@ -734,38 +735,39 @@ Public Sub Build(strSourceFolder As String _
' Resolve any relative directives (i.e. "\..\") to actual path
If FSO.FileExists(strPath) Then strPath = FSO.GetFile(strPath).Path
If strPath = vbNullString Then
MsgBox2 T("Unable to determine database file name"), T("Required source files were not found or could not be parsed:"), strSourceFolder, vbExclamation
MsgBox2 T("Unable to determine database file name.") _
, T("Required source files were not found or could not be parsed: "), strSourceFolder, vbExclamation
GoTo CleanUp

ElseIf StrComp(strPath, strCurrentDbFilename, vbTextCompare) <> 0 Then
If blnFullBuild Then
' Full build allows you to use source file name.
If Not MsgBox2(T("Current Database filename does not match source filename.") _
, T("Do you want to ") & strType & T(" to the Source Defined Filename?") & _
vbNewLine & vbNewLine & T("Current: ") & strCurrentDbFilename & vbNewLine & _
T("Source: ") & strPath _
, T("Do you want to {0} to the Source Defined Filename?" & vbNewLine & vbNewLine & _
"Current: {1}" & vbNewLine & _
"Source: {2}", var0:=strType, var1:=strCurrentDbFilename, var2:=strPath) _
, T("[Ok] = Build with Source Configured Name") & vbNewLine & vbNewLine & _
T("Otherwise cancel and select 'Build As...' from the ribbon to change build name. " & _
"Performing an export from this file name will also reset the file name, but will " & _
"overwrite source. If this file stared as a copy of an existing source controlled " & _
"database, select build as to avoid overwriting.") _
"database, select 'Build As...' to avoid overwriting.") _
, vbQuestion + vbOKCancel + vbDefaultButton1 _
, strType & T(" Name Conflict") _
, T("{0} Name Conflict", var0:=strType) _
, vbOK) = vbOK Then

' Launch the GUI form (it was closed a moment ago)
DoCmd.OpenForm "frmVCSMain"
Form_frmVCSMain.StartBuild blnFullBuild
Log.Error eelCritical, strType & T(" aborted. Name mismatch."), FunctionName
Log.Error eelCritical, T("{0} aborted. Name mismatch.", var0:=strType), FunctionName
GoTo CleanUp
End If

Else
MsgBox2 T("Cannot ") & strType & T(" to a different database"), _
T("The database file name for the source files must match the currently open database."), _
T("Current: ") & strCurrentDbFilename & vbNewLine & _
T("Source: ") & strPath, vbExclamation _
, strType & & T(" Name Conflict") _
MsgBox2 T("Cannot {0} to a different database.", var0:=strType) _
, T("The database file name for the source files must match the currently open database.") _
, T("Current: {0}" & vbNewLine & _
"Source: {1}", var0:=strCurrentDbFilename, var1:=strPath), vbExclamation _
, T("{0} Name Conflict", var0:=strType) _
, vbOK

GoTo CleanUp
Expand Down Expand Up @@ -799,7 +801,8 @@ Public Sub Build(strSourceFolder As String _
' Use alternate path if provided, otherwise extract the original database path from the source files.
strPath = Nz2(strAlternatePath, GetOriginalDbFullPathFromSource(strSourceFolder))
If strPath = vbNullString Then
MsgBox2 T("Unable to determine database file name"), T("Required source files were not found or could not be parsed:"), strSourceFolder, vbExclamation
MsgBox2 T("Unable to determine database file name") _
, T("Required source files were not found or could not be parsed:"), strSourceFolder, vbExclamation
GoTo CleanUp
End If
Else
Expand Down Expand Up @@ -854,8 +857,8 @@ Public Sub Build(strSourceFolder As String _
If Options.CompareLoadedVersion = evcNewerVersion Then
If MsgBox2(T("Newer VCS Version Detected"), _
T("This project uses VCS version {0} but version {1} is currently installed." & _
vbCrLf & "Would you like to continue anyway?", _
var0:=Options.GetLoadedVersion, var1:=GetVCSVersion), _
vbNewLine & "Would you like to continue anyway?" _
, var0:=Options.GetLoadedVersion, var1:=GetVCSVersion), _
T("Click YES to continue this operation, or NO to cancel."), _
vbExclamation + vbYesNo + vbDefaultButton2) <> vbYes Then
Log.ErrorLevel = eelCritical
Expand All @@ -869,8 +872,8 @@ Public Sub Build(strSourceFolder As String _
If FSO.FileExists(strPath) Then
Log.Add T("Saving backup of original database...")
Name strPath As strBackup
If CatchAny(eelCritical, "Unable to rename original file", FunctionName) Then GoTo CleanUp
Log.Add T("Saved as {0}." & FSO.GetFileName(strBackup) & "."
If CatchAny(eelCritical, T("Unable to rename original file"), FunctionName) Then GoTo CleanUp
Log.Add T("Saved as {0}.", var0:=FSO.GetFileName(strBackup))
End If
Else
' Backups for merge builds performed later,
Expand Down Expand Up @@ -987,7 +990,7 @@ Public Sub Build(strSourceFolder As String _
LogUnhandledErrors
Log.Add T("Saving backup of original database...")
FSO.CopyFile strPath, strBackup
If CatchAny(eelCritical, T("Unable to back up current database"), ModuleName & ".Build") Then GoTo CleanUp
If CatchAny(eelCritical, T("Unable to back up current database"), FunctionName) Then GoTo CleanUp
Log.Add T("Saved as {0}.", var0:=FSO.GetFileName(strBackup))
End If
Log.Spacer
Expand Down Expand Up @@ -1018,7 +1021,7 @@ Public Sub Build(strSourceFolder As String _
cCategory.Merge CStr(varFile)
End If
CatchAny eelError, T(IIf(blnFullBuild, "Build error in: {0}", "Merge error in: {0}"), _
var0:=varFile), ModuleName & ".Build", True, True
var0:=varFile), FunctionName, True, True

' Bail out if we hit a critical error.
If Log.ErrorLevel = eelCritical Then Log.Add vbNullString: GoTo CleanUp
Expand Down Expand Up @@ -1099,7 +1102,7 @@ CleanUp:
' Add performance data to log file and save file.
Perf.EndTiming
With Log
.Add vbCrLf & Perf.GetReports, False
.Add vbNewLine & Perf.GetReports, False
.SaveFile
.Active = False
End With
Expand Down Expand Up @@ -1257,7 +1260,7 @@ CleanUp:
' Add performance data to log file and save file
Perf.EndTiming
With Log
.Add vbCrLf & Perf.GetReports, False
.Add vbNewLine & Perf.GetReports, False
.SaveFile
.Active = False
.Flush
Expand Down Expand Up @@ -1310,14 +1313,14 @@ Public Sub MergeAllSource()
' Display heading
With Log
.Spacer
.Add "Beginning Merge of All Source Files", False
.Add T("Beginning Merge of All Source Files"), False
.Add CurrentProject.Name
.Add "VCS Version " & GetVCSVersion
.Add "Full Path: " & CurrentProject.FullName, False
.Add "Export Folder: " & Options.GetExportFolder, False
.Add T("VCS Version {0}", var0:=GetVCSVersion)
.Add T("Full Path: {0}", var0:=CurrentProject.FullName), False
.Add T("Export Folder: {0}", var0:=Options.GetExportFolder), False
.Add Now
.Spacer
.Add "Scanning source files..."
.Add T("Scanning source files...")
.Flush
End With

Expand Down Expand Up @@ -1345,11 +1348,11 @@ Public Sub MergeAllSource()
' Only show category details when source files are found
If dFiles.Count = 0 Then
Log.Spacer Options.ShowDebug
Log.Add "No " & LCase(cCategory.Category) & " source files found.", Options.ShowDebug
Log.Add T("No {0} source files found.", var0:=LCase(cCategory.Category)), Options.ShowDebug
Else
' Show category header
Log.Spacer Options.ShowDebug
Log.PadRight "Merging " & LCase(cCategory.Category) & "...", , Options.ShowDebug
Log.PadRight T("Merging ") & LCase(cCategory.Category) & "...", , Options.ShowDebug
Log.ProgMax = dFiles.Count
Perf.CategoryStart cCategory.Category

Expand All @@ -1359,21 +1362,21 @@ Public Sub MergeAllSource()
Log.Increment
Log.Add " " & FSO.GetFileName(varFile), Options.ShowDebug
cCategory.Merge CStr(varFile)
CatchAny eelError, "Merge error in: " & varFile, ModuleName & ".Build", True, True
CatchAny eelError, T("Merge error in: {0}", var0:=varFile), ModuleName & ".MergeAllSource", True, True

' Bail out if we hit a critical error.
If Log.ErrorLevel = eelCritical Then Log.Add vbNullString: GoTo CleanUp
Next varFile

' Show category wrap-up.
Log.Add "[" & dFiles.Count & "]" & IIf(Options.ShowDebug, " " & LCase(cCategory.Category) & " processed.", vbNullString)
Log.Add "[" & dFiles.Count & "]" & IIf(Options.ShowDebug, " " & LCase(cCategory.Category) & T(" processed."), vbNullString)
Perf.CategoryEnd dFiles.Count
End If
Next varCategory

' Show final output and save log
Log.Spacer
Log.Add "Done. (" & Round(Perf.TotalTime, 2) & " seconds)", , False, "green", True
Log.Add T("Done. ({0} seconds)", var0:=Round(Perf.TotalTime, 2)), , False, "green", True

CleanUp:

Expand All @@ -1383,7 +1386,7 @@ CleanUp:
' Add performance data to log file and save file
Perf.EndTiming
With Log
.Add vbCrLf & Perf.GetReports, False
.Add vbNewLine & Perf.GetReports, False
.SaveFile
.Active = False
.Flush
Expand Down Expand Up @@ -1486,9 +1489,9 @@ Private Sub CheckForLegacyModules()
If Options.ShowVCSLegacy Then
If FSO.FileExists(Options.GetExportFolder & FSO.BuildPath("modules", "VCS_ImportExport.bas")) Then
MsgBox2 T("Legacy Files not Needed"), _
T("Other forks of the MSAccessVCS project used additional VBA modules to export code.") & vbCrLf & _
T("This is no longer needed when using the installed Version Control Add-in.") & vbCrLf & vbCrLf & _
T("Feel free to remove the legacy VCS_* modules from your database project and enjoy" & vbCrLf & _
T("Other forks of the MSAccessVCS project used additional VBA modules to export code.") & vbNewLine & _
T("This is no longer needed when using the installed Version Control Add-in.") & vbNewLine & vbNewLine & _
T("Feel free to remove the legacy VCS_* modules from your database project and enjoy" & vbNewLine & _
"a simpler, cleaner code base for ongoing development. :-)"), _
T("NOTE: This message can be disabled in 'Options -> Show Legacy Prompt'."), _
vbInformation, T("Just a Suggestion...")
Expand Down

0 comments on commit 631f57e

Please sign in to comment.