Catalog final readonly class
Minn\I18n\Catalog · public/minn/src/Minn/I18n/Catalog.php · 56 lines
One translation file's contents: its headers as written, its messages keyed the gettext way (the context, a 0x04 byte, then the original; the original alone without a context), each with its translated forms and, where the file says, the original plural, and the file's plural rule. An empty translation is still a translation: it is what the file says.
Constants and properties
| prop | readonly array $headers | Promoted from the constructor. |
| prop | readonly array $entries | Promoted from the constructor. |
| prop | readonly Minn\I18n\PluralRule $plural | Promoted from the constructor. |
Public
| new | __construct(array $headers, array $entries, Minn\I18n\PluralRule $plural)# |
| ||||||
| static | from(array $headers, array $entries): self# | A catalog from headers and entries, its plural rule taken from the headers. | ||||||
| static | key(string $original, ?string $context): string# | The lookup key for an original in a context; an empty or missing context is no context. | ||||||
| method | headerValue(string $name): ?string# | A header's value, its name matched without case. | ||||||
| method | translate(string $key): ?string# | The translation of a message, empty when the file says so, or null when the file has no entry. | ||||||
| method | translatePlural(string $key, int $count): ?string# | The form of a message a count takes under this file's rule (the first form when the file has fewer), or null when the file has no entry. | ||||||
| method | has(string $key): bool# | Whether the file has an entry for the message. |
Nothing matches.