---
title: Language translation retrieval
summary: Loads single translation rows or filtered translation collections from the language translation table.
status: draft
owner: SAIF
last_reviewed: 2026-07-30
library: SAIF.Business
reference_type: package
operation_id: OP-SB-05
trigger: Caller requests translated lookup text.
---

# 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](../sql/SQL-031-language-translation-retrieval.md), [LANGUAGE_TRANSLATION](../database-tables.md#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](../sql/SQL-032-language-translation-collection-retrieval.md), [LANGUAGE_TRANSLATION](../database-tables.md#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.

```mermaid
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.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `Business\SAIF.Business\clsLanguageTranslation.vb`
- `Business\SAIF.Business\clsLanguageTranslationCollection.vb`
