ISetupTranslationsTable
Defines the public contract for the SetupTranslationsTable class, exposing methods to initialise, configure, and synchronise a managed translations ListObject against a watcher registry, handle language columns, report missing or duplicate labels, and export translations to external workbooks.
Depends on: IApplicationState
Initialisation
Initialise #
Provide the translations table ListObject and optional application scope.
Signature:
Public Sub Initialise(ByVal translationTable As ListObject, Optional ByVal stateScope As IApplicationState)
Parameters:
translationTable: ListObject. The managed translations table.stateScope: Optional IApplicationState. Guard for Excel settings during updates.
Configuration
HostWorksheet #
Retrieve the worksheet hosting the translations table.
Signature:
Public Property Get HostWorksheet() As Worksheet
Returns: Worksheet. The parent worksheet of the managed ListObject.
TableName #
Retrieve the managed ListObject name.
Signature:
Public Property Get TableName() As String
Returns: String. The name of the translations table.
Update pipeline
EnsureLanguages #
Ensure that language columns exist within the table.
Signature:
Public Sub EnsureLanguages(Optional ByVal languages As String = vbNullString)
Parameters:
languages: Optional String. Semicolon-separated list of language headers to append.
SwitchDefaultLanguage #
Promote an existing language column to become the default language.
Signature:
Public Sub SwitchDefaultLanguage(ByVal languageName As String)
Parameters:
languageName: String. Name of the language column to promote.
SwitchableLanguages #
Retrieve languages that can be promoted to default.
Signature:
Public Function SwitchableLanguages() As BetterArray
Returns: BetterArray. Array of non-default language names.
Languages #
Retrieve translation languages excluding the default column unless requested.
Signature:
Public Property Get Languages(Optional ByVal includeDefault As Boolean = False) As BetterArray
Parameters:
includeDefault: Optional Boolean. When True, includes the default language. Defaults to False.
Returns: BetterArray. Array of language names.
UpdateFromRegistry #
Synchronise translations against the supplied registry sheet.
Signature:
Public Sub UpdateFromRegistry(ByVal registrySheet As Worksheet, Optional ByVal languages As String = vbNullString)
Parameters:
registrySheet: Worksheet. Worksheet hosting the registry ListObjects with named ranges and statuses.languages: Optional String. Semicolon-separated set of languages to ensure before syncing.
ResetSequence #
Reset the hidden update sequence counter.
Signature:
Public Sub ResetSequence(ByVal registrySheet As Worksheet)
Parameters:
registrySheet: Worksheet. The worksheet whose counter should be reset.
NumberOfMissing #
Summarise and optionally display missing translation counts.
Signature:
Public Function NumberOfMissing() As String
Returns: String. Summary message listing missing counts per language.
DuplicateLabels #
Summarise duplicate labels for the specified language or across all languages.
Signature:
Public Function DuplicateLabels(ByRef duplicateMessage As String, Optional ByVal languageName As String = vbNullString) As Boolean
Parameters:
duplicateMessage: String (ByRef). Receives the formatted duplicate report.languageName: Optional String. Scope the check to a single language. Defaults to all.
Returns: Boolean. True when duplicates were detected.
InternalMissingSummary #
Retrieve the cached missing summary across languages.
Signature:
Public Property Get InternalMissingSummary() As BetterArray
Returns: BetterArray. Cloned copy of the internal missing-labels summary.
InternalDuplicatesSummary #
Retrieve the cached duplicate summary across languages.
Signature:
Public Property Get InternalDuplicatesSummary() As BetterArray
Returns: BetterArray. Cloned copy of the internal duplicates summary.
SetDisplayPrompts #
Enable or disable prompts when reporting missing translations.
Signature:
Public Sub SetDisplayPrompts(ByVal state As Boolean)
Parameters:
state: Boolean. True enables prompts; False suppresses them.
MissingLabels #
Count missing translation labels for a specific language.
Signature:
Public Function MissingLabels(ByVal lang As String) As Long
Parameters:
lang: String. Language name to inspect.
Returns: Long. Number of blank cells in the language column.
Data exchange
Export #
Export translations into a destination workbook.
Signature:
Public Sub Export(ByVal exportWorkbook As Workbook, Optional ByVal Hide As Long = xlSheetVisible)
Parameters:
exportWorkbook: Workbook. Destination workbook receiving the translations sheet.Hide: Optional Long. Visibility flag applied to the exported sheet. Defaults to xlSheetVisible.
Identity
Self #
Retrieve the interface bound to the current instance.
Signature:
Public Property Get Self() As ISetupTranslationsTable
Returns: ISetupTranslationsTable. The typed self-reference.