Constructs and stores instances of translators that can be retrieved by name and locale.
_fallbackLoader( string $name , string $locale )
Returns a new translator instance for the given name and locale based of conventions.
$name
$locale
Aura\Intl\Translator
_getFromLoader( string $name , string $locale )
Registers a new package by passing the register loaded function for the package name.
$name
$locale
Aura\Intl\TranslatorInterface
_getTranslator( string $name , string|null $locale )
Gets a translator from the registry by package for a locale.
$name
$locale
Aura\Intl\TranslatorInterface
_partialLoader( )
Returns a function that can be used as a loader for the registerLoaderMethod
callable
defaultFormatter( string|null $name null )
Sets the name of the default messages formatter to use for future translator instances.
If called with no arguments, it will return the currently configured value.
$name
optional null string
get( string $name , string|null $locale null )
Gets a translator from the registry by package for a locale.
$name
$locale
optional null Aura\Intl\TranslatorInterface
Aura\Intl\Exception
registerLoader( string $name , callable $loader )
Registers a loader function for a package name that will be used as a fallback in case no package with that name can be found.
Loader callbacks will get as first argument the package name and the locale as the second argument.
$name
$loader
setCacher( Cake\Cache\CacheEngine $cacher )
Sets the CacheEngine instance used to remember translators across requests.
Cake\Cache\CacheEngine
$cacher
setLoaderFallback( string $name , callable $loader )
Set domain fallback for loader.
$name
$loader
callable
useFallback( boolean $enable true )
Set if the default domain fallback is used.
$enable
optional true
© 2005–2016 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.
http://api.cakephp.org/3.1/class-Cake.I18n.TranslatorRegistry.html