public static function createTranslationManager(ContainerInterface $container): TranslationManagerContract
    {
        $options = self::resolveOptions($container->get('config'));

        $manager = new TranslationManager($container->get(MessageFormatterContract::class));

        if ($container->has(LoaderContract::class)) {
            $manager->setLoader($container->get(LoaderContract::class));
        }

        if (isset($options['locale'])) {
            $manager->setLocale($options['locale']);
        }

        if (isset($options['directories'])) {
            $manager->setDirectories($options['directories']);
        }

        if (isset($options['files'])) {
            foreach ((array) $options['files'] as $import) {
                $manager->import($import);
            }
        }

        if ($container->has(PsrLoggerInterface::class)) {
            $manager->setLogger($container->get(PsrLoggerInterface::class));
        }

        return $manager;
    }