it's a good idea to revisit that structure before Rails 2.2 gets
released and people start relying on it.
I'd prefer to keep the keys as short as possible (they're already
scoped, so clashes are no problem). E.g.
models.attributes instead of models.attribute_names
errors.messages instead of errors. error_messages
How about
errors.message.header and
errors.message.body
instead of
errors.message.header_message and
errors.message
Or maybe it even should be
errors.template.header and
errors.template.body
> And while on this point, wouldn't it be nice if we had interpolation
> on the error messages? It is sometimes difficult to make a proper
> sentence when the attribute name is always at the start.
>
> blank: "{{attribute}} can't be blank"
You can now do that with the custom messages. Oh! No, the attribute
name is not passed, right? I agree that would be useful.
I'd not change the default error messages for this Rails version though.
Another thought: It would be awesome if on your translations list
there would be the variables listed that are available for the
translations even when they're not used in the default translations.
Some get a :count option passed, some :count and :value. I'm not
really sure these are done in a consistent either, too.
> Furthermore, why aren't all the other modules in their proper scope?
> Why isn't number in the action_pack scope and date in the
> active_support scope? Same goes for date/time.
I just picked them this way because I thought even though date formats
etc. are added from actionpack and activesupport these are kind of
crosscutting things, not specific to these libraries. While
ActiveRecord error messages certainly are.
I don't feel strong about this at all.
Any other opinions?
> Should we be having those underscores even there? I thought DHH's
> preference was without underscores?
Hu? Eh. Yo ... didn't know about that. Yeah, maybe it's nicer without
them.
> Give me your thoughts (and I promise I'll take good care of them ;) )
Great :)
Can you manage this task? So that we'd have consistent and useful keys
when Rails 2.2 gets out of the door?
I'm a bit swamped these days ...
--
sven fuchs sven...@artweb-design.de
artweb design http://www.artweb-design.de
grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile)
<snip>
>>> blank: "{{attribute}} can't be blank"
>> You can now do that with the custom messages. Oh! No, the attribute
>> name is not passed, right? I agree that would be useful.
>>
>> I'd not change the default error messages for this Rails version
>> though.
>>
>> Another thought: It would be awesome if on your translations list
>> there would be the variables listed that are available for the
>> translations even when they're not used in the default translations.
>> Some get a :count option passed, some :count and :value. I'm not
>> really sure these are done in a consistent either, too.
<snap>
> I'll take that challenge.
Awesome!
> All for fame and glory, right?
Sure :)
"Planets devastated
Mankinds on its knees
A saviour comes from out the skies
In answer to their pleas"
Hmmm ... as you'd touch Rails (right?) it most probably would make
sense if you'd work on this branch:
http://github.com/svenfuchs/rails/tree/i18n
... cause I've already done some work on the yaml part. No actual yaml
files, yet, though iirc.
Btw do you have an IM account? Might be useful for quick questions?
Mine is sven...@jabber.org
Also I've started hanging out on #rails-i18n on irc.freenode.net
--
sven fuchs sven...@artweb-design.de
Got it.
I applied all of your patches (including the actionpack translations,
that were just some minor typos etc) to my Rails branch:
http://github.com/svenfuchs/rails/commits/i18n/
> I think we should get these things into core pretty soon so we have a
> chance to test everything before RailsConf.
Iain, could you take care of the #generate_message and custom
activerecord messages part (i.e. the changed scopes we've discussed)?