class LanguageCode (View source)

LanguageCode class is used for retrieving language names based on their codes.

This class contains an associative array of language codes and their corresponding names.

Constants

private REGIONAL_OVERRIDES

private RTL_LANGUAGES

private LANGUAGE_CODES

Methods

static string|null
getByLocale(string $locale)

Returns the language name corresponding to the given locale.

static bool
isRtl(string $locale)

No description

static array
templateVars(string $locale)

Returns template vars (is_rtl, html_dir, html_lang, bootstrap_css) for a locale.

Details

static string|null getByLocale(string $locale)

Returns the language name corresponding to the given locale.

Parameters

string $locale

The locale string (e.g., en_EN, de_DE, etc.)

Return Value

string|null

The language name if the locale is found, null otherwise.

static bool isRtl(string $locale)

No description

Parameters

string $locale

Return Value

bool

static array templateVars(string $locale)

Returns template vars (is_rtl, html_dir, html_lang, bootstrap_css) for a locale.

Used by header/footer renderers and the installer to drive RTL layout.

Parameters

string $locale

Return Value

array