-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Adding Translation Providers #38475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9fe79c7
to
6406e7b
Compare
@fabpot @nicolas-grekas @Nyholm I've continued this PR this week and I've reached a level where I think a first code review seems necessary. What has been done:
What I have a doubt about:
I'm listening to comments and feedback to move this feature forward, in order to make it available for 5.3. |
7abc84f
to
2869a15
Compare
f8121cb
to
f64d8e5
Compare
5fceba0
to
a97bd14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Great work!
I understand you don't want to add symfony/http-client
as a dependency to the Translator component, but we should not be so generous with optional arguments, ie the Factories and providers.
src/Symfony/Bundle/FrameworkBundle/Command/TranslationPullCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/TranslationPullCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Catalogue/AbstractOperation.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Provider/TranslationProviders.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Provider/ProvidersFactory.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Provider/ProviderDecorator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Provider/ProviderInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Provider/ProvidersFactory.php
Outdated
Show resolved
Hide resolved
@fabpot @Nyholm @nicolas-grekas All comments have been addressed, the CI failures on AppVeyor are unrelated to this PR. Thank you all for your reviews and your help to fix it. |
src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php
Outdated
Show resolved
Hide resolved
9095890
to
7c182f5
Compare
Thank you @fabpot, I've addressed your last comments |
Co-authored-by: Olivier Dolbeau <github@a.bbnt.me>
7c182f5
to
6e55fa8
Compare
I've just rebased the branch on 5.x |
Thank you @welcoMattic. |
I will create the subtree split for the Loco provider after having merged the PRs that will add the other providers. |
Wohoo. Thank you @welcoMattic, @odolbeau and others for all the work you've put in. |
Thanks @welcoMattic, great job!! |
} | ||
|
||
$endpoint = sprintf('%s%s', 'default' === $dsn->getHost() ? self::HOST : $dsn->getHost(), $dsn->getPort() ? ':'.$dsn->getPort() : ''); | ||
$client = $this->client->withOptions([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In notifier bridges we do this in the transport. Imho the Factory does not need to know the endpoint.
plus we are consistent for mailer notifier and translation afterwards and the mailer and notifier bridges are quite bulletproof
…ii-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
This PR was merged into the 5.3-dev branch. Discussion ---------- [Translation] Added PoEditor Provider | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#15310 To follow up on #38475, this PR adds [PoEditor](https://poeditor.com/) Provider. The todo list to make it ready is: - [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface) - [x] Add PoEditorProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file - [x] Add PoEditor case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException` - [x] Write integration tests by mocking HTTP Responses The major part of the remaining work concerns tests, I will make it done before the beginning of May. Commits ------- 240ac22 Added PoEditor Provider
This PR was merged into the 5.3-dev branch. Discussion ---------- [Translation] Added Lokalise Provider | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#15310 To follow up on #38475, this PR adds [Lokalise](https://lokalise.com/) Provider. The todo list to make it ready is: - [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface) - [x] Add LokaliseProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file - [x] Add Lokalise case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException` - [x] Move `LokaliseProvider` and `LokaliseProviderFactory` from `Symfony\Component\Translation\Bridge\Lokalise\Provider` to `Symfony\Component\Translation\Bridge\Lokalise` namespace - [x] Write integration tests by mocking HTTP Responses The major part of the remaining work concerns tests, I will make it done before the beginning of May. Commits ------- 022d828 Added Lokalise Provider
This PR was submitted for the 5.4 branch but it was squashed and merged into the 5.3 branch instead. Discussion ---------- [Translation] Introduce Translation Providers Docs for symfony/symfony#38475, symfony/symfony#40926, symfony/symfony#40927, and symfony/symfony#40947 Ready for first review, but I'm not sure that I've written documentation in the right and all required places. ATM, Translation Providers Bridges packages doesn't exists, so Flex recipes are not created yet. Commits ------- 943a63f [Translation] Introduce Translation Providers
This PR refers to the early opened RFC #36543 about adding third party translation SaaS into Symfony.
I worked in collaboration with @odolbeau on this first draft.
We have implemented only Loco Provider for now, to validate the main workflow of the feature.
We are not very sure about some naming convention, such as Remote Storage, it might be renamed in Transport, to correspond to the naming of third party services in Mailer and Notifier Components.We use Provider name.This PR brings 2 new commands in Translation component:
translation:push
andtranslation:pull
It adds also new configuration entry:
To do
Docs:
Adapt language settings in Lokalise to be sure that Symfony locales match with Lokalise languages
Todo:
These 3 providers are implemented separately. They are not fully tested yet, it is planned to make it done by the end of April 2021.