Skip to content

Commit 3277fc2

Browse files
committed
minor symfony#1543 Use app. prefix for parameters (seb-jean)
This PR was squashed before being merged into the main branch. Discussion ---------- Use `app.` prefix for `parameters` I changed the `locale` setting to put the `app.` prefix in order to follow best practices. https://symfony.com/doc/current/best_practices.html#use-short-and-prefixed-parameter-names : > Consider using app. as the prefix of your [parameters](https://symfony.com/doc/current/configuration.html#configuration-parameters) to avoid collisions with Symfony and third-party bundles/libraries parameters. Then, use just one or two words to describe the purpose of the parameter Commits ------- 032214e Use `app.` prefix for `parameters`
2 parents 7a5b7e4 + 032214e commit 3277fc2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

config/packages/translation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# See https://symfony.com/doc/current/translation.html
22
framework:
3-
default_locale: '%locale%'
3+
default_locale: '%app.locale%'
44
translator:
55
# Translations are defined using the ICU Message Format
66
# See https://symfony.com/doc/current/translation/message_format.html
77
default_path: '%kernel.project_dir%/translations'
88
fallbacks:
9-
- '%locale%'
9+
- '%app.locale%'
1010
providers:
1111
# crowdin:
1212
# dsn: '%env(CROWDIN_DSN)%'

config/routes.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ homepage:
77
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction
88
defaults:
99
template: default/homepage.html.twig
10-
_locale: '%locale%'
10+
_locale: '%app.locale%'
1111

1212
controllers:
1313
resource:
@@ -16,4 +16,4 @@ controllers:
1616
type: attribute
1717
prefix: /{_locale}
1818
defaults:
19-
_locale: '%locale%'
19+
_locale: '%app.locale%'

config/services.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Put parameters here that don't need to change on each machine where the app is deployed
55
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
66
parameters:
7-
locale: 'en'
7+
app.locale: 'en'
88
app.notifications.email_sender: [email protected]
99

1010
services:
@@ -17,7 +17,7 @@ services:
1717
# defined/created in this file; if some argument is used rarely, instead of defining
1818
# it here you can use the #[Autowire] attribute to inject it manually in the service constructor
1919
array $enabledLocales: '%kernel.enabled_locales%'
20-
string $defaultLocale: '%locale%'
20+
string $defaultLocale: '%app.locale%'
2121

2222
# makes classes in src/ available to be used as services
2323
# this creates a service per class whose id is the fully-qualified class name

0 commit comments

Comments
 (0)