Skip to content
docsv0.34.0

Catalog

Every human-facing string of the panel, by key, in English (default) and Spanish. The panel never hardcodes copy: a view asks for a key and the catalog answers in the declared locale, falling back to English, and to the key itself when nobody wrote it. A section's title may be a key the catalog knows or a literal the plugin chose — {@see self::has()} tells them apart.

Catalog::__construct()

public function __construct(string $locale = self::DEFAULT_LOCALE):

Parameters

Parameters of __construct()
NameTypeDescription
$localestring

Catalog::tr()

public function tr(string $key, string ...$args): string

The message for a key in the catalog's locale, with `sprintf` arguments applied; the key itself when unknown.

Parameters

Parameters of tr()
NameTypeDescription
$keystring
$argsstring

Catalog::has()

public function has(string $key): bool

True when the catalog knows the key — how a section title is told apart from a literal.

Parameters

Parameters of has()
NameTypeDescription
$keystring

Catalog::locale()

public function locale(): string

The locale this catalog answers in.

Catalog::locales()

public static function locales(): array

The locales the catalog carries.