Home › Packages › languages

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

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
textString 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.
greetInvoid greetIn(String locale)No description in source.
resolveActiveString 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.
mainvoid 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
localeString localeBCP-47 code, e.g. "fr"
nameString nameendonym, e.g. "Français"
directionString direction"ltr" or "rtl"

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String code, String endonym, String dir)No description in source.
isRightToLeftboolean isRightToLeft()No description in source.
codeString code()No description in source.
endonymString 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
activeString activeactive locale code (default "en")

Methods — the actions this unit can perform.

MethodSignatureWhat it does
usevoid use(String code)No description in source.
currentString current()No description in source.
localeCountint localeCount()The set of locales shipped under /languages, as a stable count + probe.
hasboolean 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.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
activeString activeactive locale code (default "en")
fallbackString fallbackfallback locale when a key/pack is missing
respectDirectionboolean respectDirectionhonor #!direction (ltr/rtl) for layout
enablePlaceholdersboolean enablePlaceholdersfill {0},{1},... in messages
missingKeyString missingKey"key" (echo the key) or "empty" (empty string)

Methods — the actions this unit can perform.

MethodSignatureWhat it does
defaultsvoid defaults()Defaults matching languages/settings.conf.
setActivevoid setActive(String code)No description in source.
activeLocaleString activeLocale()No description in source.
fallbackLocaleString fallbackLocale()No description in source.
resolveString 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.