-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added support for symfony translations providers like loco #130
base: master
Are you sure you want to change the base?
Conversation
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.
@@ -25,7 +25,8 @@ | |||
"nette/routing": "^3.0", | |||
"nette/utils": "^3.2.1|~4.0.0", | |||
"symfony/translation": "^6.0|^7.0", | |||
"symfony/config": "^6.0|^7.0" | |||
"symfony/config": "^6.0|^7.0", | |||
"symfony/finder": "^6.0|^7.0" |
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 this dependency?
@@ -187,6 +201,9 @@ public function loadConfiguration(): void | |||
$translator->setAutowired($autowired); | |||
} | |||
|
|||
$reader = $builder->addDefinition($this->prefix('providerTranslationReader')) | |||
->setFactory(TranslationReader::class); |
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.
coding style, missing one more tab
|
||
|
||
$neonFileDumper = $builder->addDefinition($this->prefix('neonFileDumper')) | ||
->setFactory(NeonFileDumper::class); |
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.
cs
$providers = []; | ||
foreach ($this->config->providers as $k1 => $v1) { | ||
|
||
if (!isset($v1['provider'])) |
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.
missing brackets
|
||
$providers[$k1] = $provider; | ||
|
||
/*if (!isset($this->config->providers[$k1]['domains']) || empty($this->config->providers[$k1]['domains'])) { |
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 this?
// Symfony providers | ||
|
||
$builder->addDefinition($this->prefix('providerCurlHttpClient')) | ||
->setFactory(CurlHttpClient::class); |
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.
cs and more on other places
} | ||
|
||
$builder->addDefinition($this->prefix('providerCollectionFatory')) | ||
->setFactory(TranslationProviderCollectionFactory::class, ["factories" => $providers, 'enabledLocales' => $this->config->locales->whitelist]); |
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.
mixing single quotes and double quotes
/** | ||
* NeonFileDumper generates yaml files from a message catalogue. | ||
* | ||
* @author Lukas Divacky <[email protected]> |
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.
no need, your name will be in release notes
Added support for symfony translations providers like loco (https://localise.biz/)
https://symfony.com/doc/current/translation.html#installing-and-configuring-a-third-party-provider
New config items for translation in config.neon looks like:
providers:
loco:
provider: Symfony\Component\Translation\Bridge\Loco\LocoProviderFactory
dsn: %loco.dsn%
locales: [cs_CZ, sk_SK]
domains: []