Skip to content

Language translation retrieval

This operation reads the LANGUAGE_TRANSLATION table for one exact translation row or for a broader collection keyed by language and optional gender. It supplies translation support to higher-level lookup helpers in the library.

Field Value
Operation ID OP-SB-05
Trigger Caller invokes GetLanguageTranslation or instantiates a translation collection criteria object.
Inputs Language code, gender code, lookup value
Outputs clsLanguageTranslation or clsLanguageTranslationCollection
Primary components clsLanguageTranslation.GetLanguageTranslation, clsLanguageTranslation.Criteria.BeforeRetrieve, clsLanguageTranslationCollection.Criteria.BeforeRetrieve
Entry point Business\SAIF.Business\clsLanguageTranslation.vb

Steps

  1. Single-row retrieval builds criteria from a language code, gender code, and lookup value.
  2. The criteria execute the exact-match translation SQL against LANGUAGE_TRANSLATION, using all three fields to find the requested row (SQL-031, LANGUAGE_TRANSLATION).
  3. After retrieval, the object copies the translated text and associated codes into clsLanguageTranslation and returns it to the caller.
  4. Collection retrieval chooses one of three shapes: all rows, language-only rows, or language-plus-gender rows.
  5. The collection criteria execute the corresponding LANGUAGE_TRANSLATION query and apply whichever filters were enabled by the constructor path (SQL-032, LANGUAGE_TRANSLATION).
  6. AfterRetrieve wraps each row in a translation item and returns the collection for later lookup or enumeration.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Translation request]) --> Type{Single row or collection?}
    Type -->|Single| Single[Query exact language, gender, and lookup value]
    Type -->|Collection| Collection[Query all, by language, or by language and gender]
    Single --> Return1([Return translation])
    Collection --> Return2([Return collection])

Failure and edge-case behavior

  • Exact-match lookups return an empty object when no row exists for the supplied language, gender, and lookup value.
  • Collection constructors determine the filter shape up front, so later callers only receive the rows allowed by that constructor path.

Sources

  • Business\SAIF.Business\clsLanguageTranslation.vb
  • Business\SAIF.Business\clsLanguageTranslationCollection.vb