Hey guys,
thanks for nudging me on this one.
Structuring and naming translation keys, whether to reuse keys or
not ... has always caused tons of discussions and you can imagine that
everybody has their favorite bikeshed color depending on their type
and scale of applications, requirements, work environments ...
In the end, we're a bit late with this discussion because the ship has
sailed with the release of 2.2.2
I agree that :activerecord as a scope might be a tad too technical for
some peoples taste. But, if you think about it, the :activerecord
scope isn't that bad either. It's a tighter scope than :model would be
(as already mentioned by others there can be other model types that
might require different translations because they're a different
context) - and that means it's the more defensive way of scoping. And
picking a more defensive option is not a bad thing for a framework to
do imo.
That said ... I haven't thought this through, but we already discussed
the idea of having "symlinks" or "aliases" in the backend, somewhere,
too:
What happens when the result of a lookup is a symbol? IIRC that case
is not defined, yet, and the obvious thing might be to treat it as a
key, i.e. as a pointer to somewhere else. This would allow you to
structure your translations in any way you want, even those that are
used by the framework.
models:
user:
email: ymmayhle
activerecord:
attributes:
user:
name: :"models.user.email"
I'm pretty sure this wouldn't go into the SimpleBackend at once, but I
can't see a reason why it wouldn't integrate nicely as a tiny plugin
either. So you could give it a shot and we could see how it works out.