IDesignerTranslation

Defines the public contract for the DesignerTranslation class, exposing methods to retrieve translation objects for different content types (messages, shapes, ranges, dropdowns), translate an entire designer worksheet with a language string, and look up individual translated message values. The language code is persisted as a worksheet-level HiddenName for cross-session persistence.

Properties

TransObject #

Translation object for a given content type

Signature:

Public Property Get TransObject(Optional ByVal trans As Byte = DesignerTranslationOfMessages) As ITranslationObject: End Property

Returns an ITranslationObject configured for the requested translation scope (messages, shapes, ranges, or dropdowns). The returned object reads from the corresponding ListObject on the translation sheet using the current designer language.

Parameters:

  • trans: Optional Byte. TranslationType value selecting the content scope. Defaults to TranslationOfMessages.

Returns: ITranslationObject. The translation object for the requested scope.


Methods

TranslateDesigner #

Translate an entire designer worksheet

Signature:

Public Sub TranslateDesigner(ByVal mainsh As Worksheet, ByVal language As String): End Sub

Applies translations to all shapes, named ranges, and dropdown validations on the supplied worksheet. When a non-empty language string is provided (e.g. "FRA - Francais"), extracts the language code and persists it to the worksheet-level HiddenName. When language is empty, reads the stored language code from the HiddenName. Exits silently when no language code is available.

Parameters:

  • mainsh: Worksheet. The designer worksheet to translate.
  • language: String. Language string in "CODE - Label" format (e.g. "FRA - Francais"). Pass vbNullString to use the stored language.

TranslatedValue #

Get the translated value of a message code

Signature:

Public Function TranslatedValue(ByVal msgCode As String) As String: End Function

Looks up a message code in the messages translation table and returns the translated string for the current designer language.

Parameters:

  • msgCode: String. The message code to translate.

Returns: String. The translated message text.