mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 07:36:30 +03:00
feature #75 [Translation] Allow using "etc/translations" to store translations files (Pierstoval)
This PR was squashed before being merged into the master branch (closes #75).
Discussion
----------
[Translation] Allow using "etc/translations" to store translations files
| Q | A
| ------------- | ---
| License | MIT
For now, translations are stored in Symfony's default directory which is `%kernel.root_dir%/Resources/translations`, resolved to `src/Resources/translations`.
I find it much more convenient to store it in `etc/translations`.
I'm not sure about some things though:
* The yaml file name, `translation.yaml`, as this config is part of the framework and we cannot "update" the `framework.yaml` file with this recipe 😕 Maybe should I rename it `symfony_translation.yaml` or `translator`, or even maybe `symfony_translator`?
* Adding `%locale%` parameter with `en` by default. As it's not mandatory to have a `%locale%` parameter in Symfony apps anymore, I thought it would be useful to setup at least this value and add a comment to tell the user to update it depending on his/her application.
What do you think?
Commits
-------
b3dc37b [Translation] Allow using "etc/translations" to store translations files
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
framework:
|
||||
default_locale: '%locale%'
|
||||
translator:
|
||||
paths:
|
||||
- '%kernel.project_dir%/translations/'
|
||||
fallbacks:
|
||||
- '%locale%'
|
||||
@@ -1,3 +1,10 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"translations/": "translations/"
|
||||
},
|
||||
"container": {
|
||||
"locale": "en"
|
||||
},
|
||||
"aliases": ["translator"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user