translate()
Overview
public string function translate(
required string enum
, required string key
, required string property
, string defaultValue
, array data
)
Translates an enum item property, using any URI template registered for the enum or the default enum.{enum}:{key}.{property} pattern.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| enum | string | Yes | ID of the enum |
| key | string | Yes | Enum item key |
| property | string | Yes | i18n property, e.g. label, description, iconClass |
| defaultValue | string | No | Fallback when the resource is missing. Defaults to the key for `label`, otherwise empty string |
| data | array | No | Optional data array passed through to translateResource |