8000 feature #40947 [Translation] Added Crowdin Translation Provider (andr… · symfony/symfony@6bfb509 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6bfb509

Browse files
committed
feature #40947 [Translation] Added Crowdin Translation Provider (andrii-bodnar)
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- [Translation] Added Crowdin Translation Provider | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | <!-- required for new features --> To follow up on #38475, this PR adds [Crowdin](https://crowdin.com/) Provider. This provider was removed a few weeks ago from the Translation Providers feature by `@welcoMattic`. We discussed all the recent changes made on `ProviderInterface`, `TranslatorBagInterface`, and others and I already applied these changes to Crowdin Provider. Also, this Provider is adapted to work with both [Crowdin](https://crowdin.com/) and [Crowdin Enterprise](https://crowdin.com/enterprise). The todo list to make it ready is: - [x] Write integration tests by mocking HTTP Responses I will make it done before the beginning of May. Commits ------- d7fda16 [Translation] Added Crowdin Translation Provider
2 parents 1e9efea + d7fda16 commit 6bfb509

File tree

14 files changed

+1267
-0
lines changed

14 files changed

+1267
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
use Symfony\Component\Stopwatch\Stopwatch;
170170
use Symfony\Component\String\LazyString;
171171
use Symfony\Component\String\Slugger\SluggerInterface;
172+
use Symfony\Component\Translation\Bridge\Crowdin\CrowdinProviderFactory;
172173
use Symfony\Component\Translation\Bridge\Loco\LocoProviderFactory;
173174
use Symfony\Component\Translation\Command\XliffLintCommand as BaseXliffLintCommand;
174175
use Symfony\Component\Translation\PseudoLocalizationTranslator;
@@ -1341,6 +1342,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
13411342
}
13421343

13431344
$classToServices = [
1345+
CrowdinProviderFactory::class => 'translation.provider_factory.crowdin',
13441346
LocoProviderFactory::class => 'translation.provider_factory.loco',
13451347
];
13461348

src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

14+
use Symfony\Component\Translation\Bridge\Crowdin\CrowdinProviderFactory;
1415
use Symfony\Component\Translation\Bridge\Loco\LocoProviderFactory;
1516
use Symfony\Component\Translation\Provider\NullProviderFactory;
1617
use Symfony\Component\Translation\Provider\TranslationProviderCollection;
@@ -33,6 +34,16 @@
3334
->set('translation.provider_factory.null', NullProviderFactory::class)
3435
->tag('translation.provider_factory')
3536

37+
->set('translation.provider_factory.crowdin', CrowdinProviderFactory::class)
38+
->args([
39+
service('http_client'),
40+
service('logger'),
41+
param('kernel.default_locale'),
42+
service('translation.loader.xliff'),
43+
service('translation.dumper.xliff'),
44+
])
45+
->tag('translation.provider_factory')
46+
3647
->set('translation.provider_factory.loco', LocoProviderFactory::class)
3748
->args([
3849
service('http_client'),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG
2+
=========
3+
4+
5.3
5+
---
6+
7+
* Create the bridge

0 commit comments

Comments
 (0)
0