Esempio n. 1
0
 /**
  * Returns the translators collection instance. It can be used
  * for getting specific translators based of their name and locale
  * or to configure some aspect of future translations that are not yet constructed.
  *
  * @return \Aura\Intl\TranslatorLocator The translators collection.
  */
 public static function translators()
 {
     if (static::$_collection !== null) {
         return static::$_collection;
     }
     static::$_collection = new TranslatorRegistry(new PackageLocator(), new FormatterLocator(['sprintf' => function () {
         return new SprintfFormatter();
     }, 'default' => function () {
         return new IcuFormatter();
     }]), new TranslatorFactory(), static::locale());
     if (class_exists('Cake\\Cache\\Cache')) {
         static::$_collection->setCacher(Cache::engine('_cake_core_'));
     }
     return static::$_collection;
 }