getProviderCollection example

private function createCommand(ProviderInterface $provider, array $locales = ['en'], array $domains = ['messages']$defaultLocale = 'en', array $providerNames = ['loco']): TranslationPullCommand
    {
        $writer = new TranslationWriter();
        $writer->addDumper('xlf', new XliffFileDumper());
        $writer->addDumper('yml', new YamlFileDumper());

        $reader = new TranslationReader();
        $reader->addLoader('xlf', new XliffFileLoader());
        $reader->addLoader('yml', new YamlFileLoader());

        return new TranslationPullCommand(
            $this->getProviderCollection($provider$providerNames$locales$domains),
            $writer,
            $reader,
            $defaultLocale,
            [$this->translationAppDir.'/translations'],
            $locales
        );
    }
}
$application->add($command);

        return new CommandTester($application->find('translation:push'));
    }

    private function createCommand(ProviderInterface $provider, array $locales = ['en'], array $domains = ['messages'], array $providerNames = ['loco']): TranslationPushCommand
    {
        $reader = new TranslationReader();
        $reader->addLoader('xlf', new XliffFileLoader());

        return new TranslationPushCommand(
            $this->getProviderCollection($provider$providerNames$locales$domains),
            $reader,
            [$this->translationAppDir.'/translations'],
            $locales
        );
    }
}
Home | Imprint | This part of the site doesn't use cookies.