src/Leevel/I18n/Console/Cache.php
public function handle(IApp $app): void
    {
        $this->app = $app;
        $this->extends = $this->extends();

        $this->line('Start to cache i18n.');

        list_directory($app->i18nPath(), false, function ($item) use ($app) {
            if ($item->isDir()) {
                $i18n = $item->getFilename();

                $data = $this->data($i18n);

                $cachePath = $app->i18nCachedPath($i18n);

                $this->writeCache($cachePath, $data);

                $this->info(sprintf('I18n cache file %s cache successed.', $cachePath));
            }
        });

        $this->info('I18n cache files cache successed.');
    }
public function handle(IApp $app): void
    {
        $this->app = $app;
        $this->extends = $this->extends();

        $this->line('Start to cache i18n.');

        list_directory($app->i18nPath(), false, function ($item) use ($app) {
            if ($item->isDir()) {
                $i18n = $item->getFilename();

                $data = $this->data($i18n);

                $cachePath = $app->i18nCachedPath($i18n);

                $this->writeCache($cachePath, $data);

                $this->info(sprintf('I18n cache file %s cache successed.', $cachePath));
            }
        });

        $this->info('I18n cache files cache successed.');
    }
响应命令.

@param \Leevel\Kernel\IApp $app