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:
Fabien Potencier
2017-05-27 08:37:54 -07:00
3 changed files with 14 additions and 0 deletions
@@ -0,0 +1,7 @@
framework:
default_locale: '%locale%'
translator:
paths:
- '%kernel.project_dir%/translations/'
fallbacks:
- '%locale%'
+7
View File
@@ -1,3 +1,10 @@
{
"copy-from-recipe": {
"etc/": "%ETC_DIR%/",
"translations/": "translations/"
},
"container": {
"locale": "en"
},
"aliases": ["translator"]
}