-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation][FrameworkBundle] Adding Translation Providers #37462
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
[Translation][FrameworkBundle] Adding Translation Providers #37462
Conversation
I'm really interested in this new feature! Thank you, it's promising! 👏 I also have another adapter that can be implemented: Crowdin. |
326c05e
to
de0138f
Compare
5beef58
to
b9f5792
Compare
b9f5792
to
5cd37f5
Compare
43a9251
to
9a230fd
Compare
@welcoMattic for the Transifex bridge, have you try to use |
aa50e05
to
db0a76d
Compare
Before continuing the work on this PR, I ask myself several questions:
|
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.
I've just done a very very quick review to better understand the PR and its goals.
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/Bundle/FrameworkBundle/Command/TranslationPullCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/TranslationPullCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/TranslationPushCommand.php
Outdated
Show resolved
Hide resolved
|
||
use Symfony\Component\Translation\TranslatorBag; | ||
|
||
class RemoteDecorator implements RemoteInterface |
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.
Why is it useful?
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.
It is in the read
method, that we merge wanted domains (passed as arguments in commands) with default domains (defined in configuration)
I think we would need at least 2 (or 3) providers to exercise the API and be sure it's generic and powerful enough. |
Thank you for the review. I'm ok to add 2 or 3 Providers (I will rename RemoteStorage for Provider). |
7d48c0c
to
5afca3b
Compare
@andrii-bodnar Hi, sorry but I do not understand how Crowdin API works for uploading translations. You mentioned the Upload Translations endpoint, but in the documentation, there is no mention of content uploading. How do I upload existing translations and in which format? |
Hi @welcoMattic, let's imagine you have domain admin.en.xlf and French translations - admin.fr.xlf File admin.en.xlf is being added to the Crowdin project. Now, if you want to upload admin.fr.xlf translations to Crowdin, you need to create a Storage with this file and use Upload Translations method. This method accepts |
@andrii-bodnar thank you for the quick answer. Ok, it's not very easy to understand the concepts of Storage and File, moreover with an Upload operation between them. But ok, I will try to implement this workflow in Symfony. Thanks again. |
@andrii-bodnar can we discuss by email or in Symfony Slack? I still have difficulties to send existing translations to Crowdin. |
@welcoMattic, sure, I'll try to join Symfony Slack. |
This is a very welcome feature, thanks for the work guys ! |
5afca3b
to
d88294e
Compare
Well, there's still a lot of work here before we get to a complete and stable functionality (especially for the Provider Crowdin), and then the functional tests are not written yet. For Crowdin, we have been working the last few days with @andrii-bodnar in order to implement all needed API calls, and it remains the For Transifex, I need to work again the Provider, and explore the API more deeply to find the right way to do things. For all these reasons, I think we should target a merge for 5.3, it's more reasonable than speed up work and merge an unstable feature in 5.2. |
We've just moved away from |
This PR was merged into the 5.3-dev branch. Discussion ---------- [Translation] Adding Translation Providers | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #36543 | License | MIT | Doc PR | todo > Follow up of #37462 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` and `translation:pull` It adds also new configuration entry: ```yaml framework: default_locale: fr translator: default_path: '%kernel.project_dir%/translations' enabled_locales: '%locales%' fallbacks: - en - it providers: loco: dsn: '%env(LOCO_DSN)%' domains: ['messages'] locales: '%locales%' ``` ## To do - [x] Implement Provider into Translation component - [x] Plug it into FrameworkBundle - [x] Implement pull and push commands - [x] Implement Loco adapter - [x] Tests - [ ] Documentation - [x] Update CHANGELOG.md files in FrameworkBundle and Translation Component Docs: Adapt language settings in Lokalise to be sure that Symfony locales match with Lokalise languages  Todo: - [x] Implement POEditor Provider (:warning: there is a trick to do in POEditor Dashboard in order to make XLF export works, it will have to be documented explicitly in the symfony/symfony-docs PR) - [x] Implement Lokalise Provider - [x] Implement Crowdin Provider 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. Commits ------- 6e55fa8 Added 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 StorageProvider, it might be renamed in Transport, to correspond to the naming of third party services in Mailer and Notifier Components.This PR brings 2 new commands in FrameworkBundle:
translation:push
andtranslation:pull
It adds also new configuration entry:
To do
Remote StoragesProvider into Translation componentTransifex Provider
To do:
Crowdin Provider
To do: