-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Added Lokalise Provider #40927
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
Please note that you need squash your commits before this PR can be merged. The maintainer can also squash the commits for you, but then you need to “Allow edits from maintainer” (there is a checkbox in the sidebar of the PR). Cheers! Carsonbot |
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.
Do you need to adjust UnsupoortedSchemeException like we do for the Notifier?
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
…etter (Nyholm) This PR was merged into the 5.3-dev branch. Discussion ---------- [CI] Sort packages by length to match modified package better | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Given the build error in #40927, I saw that we match "modified packages" wrong. The script things we modified `symfony/translation` rather than the new bridge. This is because we are using a simple [string matchning](https://github.com/symfony/symfony/blob/18658a29a37d6de3e73c95f96fb9e51bf1d5f59d/.github/get-modified-packages.php#L24). If we sort the packages by length, we make sure we match the most detailed (longest) string first. Commits ------- f7a0bd1 [CI] Sort packages by length to match modified package better
c41ea84
to
749cca8
Compare
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php
Outdated
Show resolved
Hide resolved
Thanks @OskarStark for the quick review, I have not finish the revamp of Lokalise accordingly to the recent changes 😉 |
status: needs review CI failures seems unrelated to this PR. |
906af69
to
d7a0ad9
Compare
d434655
to
2399fc7
Compare
2399fc7
to
608685f
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.
(with easy to fix comments)
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php
Outdated
Show resolved
Hide resolved
4fef59d
to
31df459
Compare
Tests seem broken. |
15b6ba2
to
6a5d222
Compare
@fabpot I've just pushed a fix (adding symfony/config as dev dependency of the Lokalise Provider Bridge). It fixes tests on Travis. On AppVeyor, failures seems unrelated |
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.
LGTM, to be merged after the HOST constant is fixed.
src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProviderFactory.php
Outdated
Show resolved
Hide resolved
ebd9708
to
fe0685a
Compare
@fabpot Last comment has been addressed, branch has been rebased, it looks ready 👍 |
src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProviderFactory.php
Outdated
Show resolved
Hide resolved
631b635
to
82179a6
Compare
src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProviderFactory.php
Outdated
Show resolved
Hide resolved
3b068e8
to
89f9e1d
Compare
89f9e1d
to
022d828
Compare
Thank you @welcoMattic. |
@welcoMattic actually, the symfony/config component is necessary when using the xliff loader (which is why it is only a dev dependency in symfony/translation as you are not forced to use xliff). As the Lokalise provider relies on loading xliff, it should have a non-dev requirement on symfony/config |
@welcoMattic does this provider handle properly the fact that Symfony translation keys are only unique inside a domain, not globally ? |
@stof indeed, actually all Translation Providers use About handling translation keys by domain and not glabally, I paid attention to handle it in all Providers after your first comment about it. |
yes, indeed. |
This PR was merged into the 5.3-dev branch. Discussion ---------- [Translation] Improved Translation Providers | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Some small improvements on Translation Providers: - move symfony/config from dev dependency to hard dependency for all Bridges as all providers use XliffFileLoader to load pulled translations (cf. #40927 (comment)) - replace all instances of ``` 'headers' => [ 'Authorization' => 'Bearer API_TOKEN', ] ``` with `'auth_bearer' => 'API_TOKEN',` even in tests files. - Fix Lokalise base_uri concatenation Commits ------- 84fd13c Improved Translation Providers
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
To follow up on #38475, this PR adds Lokalise Provider.
The todo list to make it ready is:
ProviderInterface
andTranslatorBagInterface
(we removed theall()
andgetDomains()
method from TranslatorBagInterface)src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php
fileSymfony\Component\Translation\Exception\UnsupportedSchemeException
LokaliseProvider
andLokaliseProviderFactory
fromSymfony\Component\Translation\Bridge\Lokalise\Provider
toSymfony\Component\Translation\Bridge\Lokalise
namespaceThe major part of the remaining work concerns tests, I will make it done before the beginning of May.