Skip to content
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

Allow for adding locales to config/services.yaml #1147

Merged
merged 1 commit into from Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion config/packages/translation.yaml
Expand Up @@ -8,7 +8,6 @@ framework:
translation:
webui:
enabled: true
locales: ['en', 'nl', 'es', 'fr', 'de', 'pl', 'it', 'hu', 'pt_BR', 'is', 'jp', 'nb', 'dk', 'pl']
edit_in_place:
enabled: false
configs:
Expand Down
2 changes: 1 addition & 1 deletion config/services.yaml
Expand Up @@ -3,7 +3,7 @@
parameters:
locale: 'en'
# This parameter defines the codes of the locales (languages) enabled in the application
app_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE
app_locales: en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE|is|ru
app.notifications.email_sender: anonymous@example.com
bolt.table_prefix: bolt_
bolt.backend_url: /bolt
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Parser/ContentTypesParser.php
Expand Up @@ -21,7 +21,7 @@ class ContentTypesParser extends BaseParser
/** @var array */
private $localeCodes = [];

public function __construct(string $locales, string $projectDir, Collection $generalConfig, string $filename = 'contenttypes.yaml')
public function __construct(?string $locales = null, string $projectDir, Collection $generalConfig, string $filename = 'contenttypes.yaml')
{
$this->localeCodes = empty($locales) ? [] : explode('|', $locales);
$this->generalConfig = $generalConfig;
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel.php
Expand Up @@ -123,7 +123,7 @@ private function flattenKeys(array $array, string $prefix = ''): array
*/
private function setContentTypeRequirements(ContainerBuilder $container): void
{
$ContentTypesParser = new ContentTypesParser('en|nl|es|fr|de|pl|it|hu|pt_BR|ja|nb|nn|nl_NL|nl_BE', $this->getProjectDir(), new Collection());
$ContentTypesParser = new ContentTypesParser(null, $this->getProjectDir(), new Collection());
$contentTypes = $ContentTypesParser->parse();

$pluralslugs = $contentTypes->pluck('slug')->implode('|');
Expand Down