This project is archived and is in readonly mode.
i18n key collision with namespaced models
-
José Valim
- State changed from new to open
- Importance changed from to Low
Bug added in this commit:
https://github.com/rails/rails/commit/8d30193b08bd2321a7a78a1f481bd...
We just need a test and revert it.
-
yves.senn (at gmail)
I added a test, which reveals the key collision.
-
Santiago Pastorino
- Milestone set to 3.0.5
- Assigned user set to Santiago Pastorino
- Importance changed from Low to Medium
-
yves.senn (at gmail)
i've just seen, that 3.0.5.rc1 has been released. Do you think this is still gonna make it into 3.0.5?
-
Repository
- State changed from open to committed
(from [a00bed0c48f469d1cd2de364bfaddbc724046195]) Revert "Properly interpolate i18n keys in modules [#5572 [PATCH] Fix i18n scope bug when class belongs to a module state:resolved]"
This breaks #6448 i18n key collision with namespaced models, you should use :"module/class" as key for namespacing
[#6448 i18n key collision with namespaced models state:committed]This reverts commit 8d30193b08bd2321a7a78a1f481bd5e4d4d45557.
https://github.com/rails/rails/commit/a00bed0c48f469d1cd2de364bfadd... -
Repository
(from [f80eea3bf30dcceaca3c4a9cd9238bdc44a9e165]) Revert "Properly interpolate i18n keys in modules [#5572 [PATCH] Fix i18n scope bug when class belongs to a module state:resolved]"
This breaks #6448 i18n key collision with namespaced models, you should use :"module/class" as key for namespacing
[#6448 i18n key collision with namespaced models state:committed]This reverts commit 8d14fa89599a30a6ab1d14faedd2de8e46651272.
https://github.com/rails/rails/commit/f80eea3bf30dcceaca3c4a9cd9238... -
Rodrigo Rosenfeld Rosas
I didn't understand the test for key collision nor the instructions for using "module/class" as key. For instance, using the standard i18n backend, would the yaml look like below?
# encoding: utf-8 module/class: name: 'Nome'Also, how is the situation described in this ticket is achieved? Are they two separate yaml files? In what directories? How does it make sense?
Thanks in advance!
-
yves.senn (at gmail)
the situation is achieved when you got a single yaml file for every model. We have the following directory structure:
config/locales/models/person/de.yml
config/locales/models/person/status/de.ymlwhere the model Person::Status is a namespaced model. We have to use a legacy database with a lot of Status models, so we namespaced them to the corresponding model. since the Person has a status attribute. there is a key collision.
I hope you can follow my explanations.
-
José Valim
So we can consider 6034 as fixed as well?
