/** * {@inheritdoc} */ public function register() { $this->container->registerSingleton([I18n::class, 'i18n'], function ($container) { $app = $container->get('app'); $cache = $container->get('config')->get('application')['language_cache']; $i18n = new I18n(new Loader($container->get('fileSystem'), $app->getPath() . '/resources/i18n'), $app->getLanguage()); if ($cache !== false) { $i18n->setCache($container->get('cache')->instance($cache === true ? null : $cache)); } return $i18n; }); }
/** * */ public function testSetCache() { $i18n = new I18n($this->getLoader(), 'en_US'); $i18n->setCache($this->getCache()); }