Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0b66008

Browse filesBrowse files
committed
feature #40927 [Translation] Added Lokalise Provider (welcoMattic)
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
2 parents af19b6b + 022d828 commit 0b66008
Copy full SHA for 0b66008

File tree

Expand file treeCollapse file tree

14 files changed

+1175
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

14 files changed

+1175
-0
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
use Symfony\Component\String\Slugger\SluggerInterface;
172172
use Symfony\Component\Translation\Bridge\Crowdin\CrowdinProviderFactory;
173173
use Symfony\Component\Translation\Bridge\Loco\LocoProviderFactory;
174+
use Symfony\Component\Translation\Bridge\Lokalise\LokaliseProviderFactory;
174175
use Symfony\Component\Translation\Bridge\PoEditor\PoEditorProviderFactory;
175176
use Symfony\Component\Translation\Command\XliffLintCommand as BaseXliffLintCommand;
176177
use Symfony\Component\Translation\PseudoLocalizationTranslator;
@@ -1345,6 +1346,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
13451346
$classToServices = [
13461347
CrowdinProviderFactory::class => 'translation.provider_factory.crowdin',
13471348
LocoProviderFactory::class => 'translation.provider_factory.loco',
1349+
LokaliseProviderFactory::class => 'translation.provider_factory.lokalise',
13481350
PoEditorProviderFactory::class => 'translation.provider_factory.poeditor',
13491351
];
13501352

Collapse file

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Translation\Bridge\Crowdin\CrowdinProviderFactory;
1515
use Symfony\Component\Translation\Bridge\Loco\LocoProviderFactory;
16+
use Symfony\Component\Translation\Bridge\Lokalise\LokaliseProviderFactory;
1617
use Symfony\Component\Translation\Bridge\PoEditor\PoEditorProviderFactory;
1718
use Symfony\Component\Translation\Provider\NullProviderFactory;
1819
use Symfony\Component\Translation\Provider\TranslationProviderCollection;
@@ -54,6 +55,15 @@
5455
])
5556
->tag('translation.provider_factory')
5657

58+
->set('translation.provider_factory.lokalise', LokaliseProviderFactory::class)
59+
->args([
60+
service('http_client'),
61+
service('logger'),
62+
param('kernel.default_locale'),
63+
service('translation.loader.xliff'),
64+
])
65+
->tag('translation.provider_factory')
66+
5767
->set('translation.provider_factory.poeditor', PoEditorProviderFactory::class)
5868
->args([
5969
service('http_client'),
Collapse file
+4Lines 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
Collapse file
+3Lines 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
Collapse file
+7Lines changed: 7 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2021 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.