src/I18n/I18N.php
public function initComponent()
    {
        return resolve(true)
            ->then(function() {
                $promises = [];
                foreach ($this->translations as $category => $config) {
                    $source = $this->getMessageSource($category);
                    $promises[] = $source
                        ->preloadMessages($category, $this->languages)
                        ->otherwise(function($error) {
                            echo gettype($error);
                        });
                }
                if (empty($promises)) {
                    return true;
                }
                return all($promises);
            })->then(function() {
                $initMessage = sprintf("%s initialized", __CLASS__);
                if (!Reaction::isConsoleApp()) {
                    Reaction::info($initMessage);
                }
                return $this->_initialized = true;
            })->otherwise(function($error) {
                if ($error instanceof \Throwable) {
                    Reaction::error($error->getMessage());
                }
                return reject($error);
            });
    }
public function initComponent()
    {
        return resolve(true)
            ->then(function() {
                $promises = [];
                foreach ($this->translations as $category => $config) {
                    $source = $this->getMessageSource($category);
                    $promises[] = $source
                        ->preloadMessages($category, $this->languages)
                        ->otherwise(function($error) {
                            echo gettype($error);
                        });
                }
                if (empty($promises)) {
                    return true;
                }
                return all($promises);
            })->then(function() {
                $initMessage = sprintf("%s initialized", __CLASS__);
                if (!Reaction::isConsoleApp()) {
                    Reaction::info($initMessage);
                }
                return $this->_initialized = true;
            })->otherwise(function($error) {
                if ($error instanceof \Throwable) {
                    Reaction::error($error->getMessage());
                }
                return reject($error);
            });
    }
Init callback. Called by parent container/service/component on init and must return a fulfilled Promise
@return PromiseInterface