Enumerate supported languages¶
Consumers that need a localized list of the languages a SAIF application supports read mdlLanguages.SupportedLanguages, which iterates the configured SupportedCultures culture codes and returns one clsLanguage per culture, pairing the raw culture code with a localized display description sourced from the Common_UI resource set.
| Field | Value |
|---|---|
| Operation ID | OP-RES-03 |
| Trigger | Caller reads the read-only module property mdlLanguages.SupportedLanguages |
| Inputs | The module-level SupportedCultures array (currently {"en", "es"}) |
| Outputs | IEnumerable(Of clsLanguage), materialized as an array, with one entry per supported culture |
| Primary components | mdlLanguages.SupportedLanguages, clsLanguage, Common_UI |
| Entry point | Resources\SAIF.Resources\mdlLanguages.vb |
Steps¶
- Caller reads the property. Accessing
SupportedLanguagesbegins building a newList(Of clsLanguage). - Iterate configured cultures. The property loops over the module-level
SupportedCulturesarray in declared order (English first, then Spanish, per the current configuration). - Resolve a localized description per culture.
- If the culture code equals
CULTURE_SPANISH("es"): the loop adds a newclsLanguage(culture, Common_UI.Spanish), using the Spanish-localized display string. - Otherwise (including
CULTURE_ENGLISH,"en"): the loop adds a newclsLanguage(culture, Common_UI.English), using the English-localized display string. - Return the results. The accumulated list is converted to an array and returned to the caller.
Process flow¶
The following diagram visualizes the language-list construction flow.
flowchart TD
Start([Caller reads SupportedLanguages]) --> Init[Create empty language list]
Init --> Loop[Iterate SupportedCultures array]
Loop --> Check{Culture code<br>equals Spanish?}
Check -->|Yes| AddEs[Add clsLanguage with<br>Common_UI.Spanish description]
Check -->|No| AddOther[Add clsLanguage with<br>Common_UI.English description]
AddEs --> More{More cultures?}
AddOther --> More
More -->|Yes| Loop
More -->|No| Return([Return array of clsLanguage]))
Failure and edge-case behavior¶
- Any culture code other than the Spanish constant (
"es") falls into theCase Elsebranch and is described using the English resource string, so a supported culture that is neither English nor Spanish would still be labeled with the English description rather than its own language name.* - Adding a new supported culture requires both appending it to
SupportedCulturesand adding a matchingCasebranch inSupportedLanguages; the module's owntodocomments flag this as a manual, two-part extension point. - The returned collection order always follows the declared order of
SupportedCultures, so English is listed before Spanish under the current configuration.
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Related documentation¶
Sources¶
Resources\SAIF.Resources\mdlLanguages.vbResources\SAIF.Resources\clsLanguage.vbResources\SAIF.Resources\Common\Common_UI.Designer.vb