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
| Name | Type | Description |
|---|---|---|
| $locale | string |
Catalog::tr()
public function tr(string $key, string ...$args): stringThe message for a key in the catalog's locale, with `sprintf` arguments applied; the key itself when unknown.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $args | string |
Catalog::has()
public function has(string $key): boolTrue when the catalog knows the key — how a section title is told apart from a literal.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Catalog::locale()
public function locale(): stringThe locale this catalog answers in.
Catalog::locales()
public static function locales(): arrayThe locales the catalog carries.