Translator to translate the message.
string 'p:'
Cake\I18n\Translator|nullA fallback translator.
Cake\I18n\FormatterInterfaceThe formatter to use when translating messages.
stringThe locale being used for translations.
Cake\I18n\PackageThe Package containing keys and translations.
Constructor
Gets the message translation by its key.
Returns the translator package
Resolve a message's context structure.
Translates the message formatting any placeholders
__construct(string $locale, Cake\I18n\Package $package, Cake\I18n\FormatterInterface $formatter, Cake\I18n\Translator|null $fallback = null)
Constructor
string $locale The locale being used.
Cake\I18n\Package $package The Package containing keys and translations.
Cake\I18n\FormatterInterface $formatter A message formatter.
Cake\I18n\Translator|null $fallback optional A fallback translator.
getMessage(string $key): mixed
Gets the message translation by its key.
string $key The message key.
mixedgetPackage(): Cake\I18n\Package
Returns the translator package
Cake\I18n\PackageresolveContext(string $key, array $message, array $vars): array|string
Resolve a message's context structure.
string $key The message key being handled.
array $message The message content.
array $vars The variables containing the _context key.
array|stringtranslate(string $key, array $tokensValues = []): string
Translates the message formatting any placeholders
string $key The message key.
array $tokensValues optional Token values to interpolate into the message.
stringA fallback translator.
Cake\I18n\Translator|nullThe formatter to use when translating messages.
Cake\I18n\FormatterInterfaceThe locale being used for translations.
stringThe Package containing keys and translations.
Cake\I18n\Package
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.I18n.Translator.html