Package languages
This package contains 4 source unit(s) defining 4 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.
languages #sleela 2.5 (lib/languages/languages.sleela)
Languages class
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
text | String text(String locale, String key) | Translate one message key into the given locale. Falls back to English for an unknown locale or key. Only a representative subset of the full key set (see /languages/KEYS.md) is shown here for the demonstration. |
greetIn | void greetIn(String locale) | No description in source. |
resolveActive | String resolveActive(String configuredActive, String override) | Resolve the active locale from settings: an explicit override (e.g. the SLEELA_LANG value a launcher supplies) wins; otherwise the configured active locale. Mirrors languages/settings.conf and SLLanguageSettings. |
main | void main() | No description in source. |
SLLanguage #sleela 2.5 (lib/languages/SLLanguage.sleela)
SLLanguage class
Defines the SLeeLa standard-library type SLLanguage used within the languages library family.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
locale | String locale | BCP-47 code, e.g. "fr" |
name | String name | endonym, e.g. "Français" |
direction | String direction | "ltr" or "rtl" |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String code, String endonym, String dir) | No description in source. |
isRightToLeft | boolean isRightToLeft() | No description in source. |
code | String code() | No description in source. |
endonym | String endonym() | No description in source. |
SLLanguageCatalog #sleela 2.5 (lib/languages/SLLanguageCatalog.sleela)
SLLanguageCatalog class
Defines the SLeeLa standard-library type SLLanguageCatalog used within the languages library family.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
active | String active | active locale code (default "en") |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
use | void use(String code) | No description in source. |
current | String current() | No description in source. |
localeCount | int localeCount() | The set of locales shipped under /languages, as a stable count + probe. |
has | boolean has(String code) | No description in source. |
SLLanguageSettings #sleela 2.5 (lib/languages/SLLanguageSettings.sleela)
SLLanguageSettings class
Defines the SLeeLa standard-library type SLLanguageSettings used within the languages library family.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
active | String active | active locale code (default "en") |
fallback | String fallback | fallback locale when a key/pack is missing |
respectDirection | boolean respectDirection | honor #!direction (ltr/rtl) for layout |
enablePlaceholders | boolean enablePlaceholders | fill {0},{1},... in messages |
missingKey | String missingKey | "key" (echo the key) or "empty" (empty string) |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
defaults | void defaults() | Defaults matching languages/settings.conf. |
setActive | void setActive(String code) | No description in source. |
activeLocale | String activeLocale() | No description in source. |
fallbackLocale | String fallbackLocale() | No description in source. |
resolve | String resolve(String override) | Resolve the locale to actually use: the explicit override wins (e.g. the SLEELA_LANG environment value a launcher supplies), else the active locale. |