---
title: GlobalizationServices
summary: API reference for GlobalizationServices.
status: draft
owner: SAIF
last_reviewed: 2026-07-24
library: SAIF.Business
reference_type: package
---

# GlobalizationServices

`GlobalizationServices` is a public class in `SAIF.Business` that generates globalization-aware code-table SQL and loads code/description items for a requested UI culture.

## Purpose
- Builds `SELECT` statements that join a primary code table to its globalization table.
- Applies translated column values when globalization rows exist and falls back to primary-table values when they do not.
- Retrieves code/description pairs for a culture-specific code table lookup.

## Context
- Namespace: `SAIF.Business`
- Assembly/package: `SAIF.Business`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `GlobalizedCodeTableSql` | `Public Shared Function GlobalizedCodeTableSql(inPrimaryTable As String, inPK As List(Of String), inGlobColumns As List(Of String), inColumns As List(Of String), Optional inGlobalTable As String = "", Optional inAdditionalJoinClause As String = "", Optional inAllCodes As Boolean = False) As String` | Builds the globalization-aware SQL statement for a code table using explicit key, translated-column, and pass-through-column lists. |
| `GlobalizedCodeTableSql` | `Public Shared Function GlobalizedCodeTableSql(inPrimaryTable As String, Optional inAllCodes As Boolean = False) As String` | Builds the default globalization SQL for code tables that use `Code` as the key and `Code_Descr` as the translated column. |
| `GetGlobalizedCodeItemCollection` | `Public Shared Function GetGlobalizedCodeItemCollection(DPI As IDataPortalInfo, inPrimaryTable As String, Optional ByVal inCultureCode As String = "") As IEnumerable(Of GlobalizedCodeItem(Of String, String))` | Executes the default globalization query and returns the resulting code/description pairs. |
| `GetCurrentUICultureCode` | `Public Shared Function GetCurrentUICultureCode() As String` | Returns the current UI culture's two-letter ISO language code. |

## Behavioral notes
- When `inGlobalTable` is empty, the SQL builder derives the globalization table name by uppercasing the primary table name and replacing `_CODE` with `_GCODE`.
- The generated SQL uses a left outer join on the supplied primary-key columns and always adds `upper(Glob.culture_code) = upper(:CultureCode)` to the join clause.
- Each translated column is emitted as a `case when Glob.<column> is null then cast( Prim.<column> as nvarchar2(200)) else Glob.<column> end` expression so untranslated values fall back to the primary table.
- `GetGlobalizedCodeItemCollection` defaults `inCultureCode` to `GetCurrentUICultureCode()` when the caller supplies an empty value.

## Constraints and usage notes
- The explicit `GlobalizedCodeTableSql` overload expects callers to supply the primary-key columns, translated columns, and pass-through columns that match the target tables.
- `GetGlobalizedCodeItemCollection` expects the generated SQL to expose `code` and `code_descr` columns because those names are hard-coded when materializing `GlobalizedCodeItem(Of String, String)` objects.
- When `inAllCodes` is `False`, the generated SQL includes a `WHERE` clause that binds each primary-key value by name.

## Sources
- `Business\SAIF.Business\GlobalizationServices.vb`
