On Wed, Mar 30, 2011 at 5:47 AM, Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com > wrote:
> This issue started here: > > > https://rails.lighthouseapp.com/projects/8994/tickets/3768-patch-add-full_message-option-to-validations#ticket-3768-69 > > Then José Valim thought it was a bug and asked me to create another issue: > > https://rails.lighthouseapp.com/projects/8994/tickets/5572 > > Then, this issue was created: > > https://rails.lighthouseapp.com/projects/8994/tickets/6448 > > Then Valim reverted 5572. > > Now I know that my i18n locale files should be written like this: > > pt-BR: > activerecord: > errors: > models: > my_module/order: > attributes: > amount: > not_a_number: deve ser um número > > I think there will be no more confusing regarding this behavior now we all > know what to expect. Maybe there is some documentation missing, regarding > modules and i18n keys. > There are two problems here. The first problem is that the public API changed between 3.0.5 and 3.0.6.rc1: the i18n_key method was removed. This is a breaking change for applications (mine included) that used this method themselves. To fix this, the method should be restored, with either the 3.0.5 definition or a new definition (depending on the solution for the second, more difficult problem). The second problem is that we now have two competing conventions for where to place translations for attributes of nested models. 3.0.0-3.0.1 used one convention ('module/model'), 3.0.2-3.0.5 used another ('module.model'), and now in 3.0.6 is reverting to the first convention. The change from 3.0.1 to 3.0.2 broke all translations which followed the original convention, and for users on 3.0.2-3.0.5, the change from 3.0.5 to 3.0.6 will break them again. In order to avoid this breaking change, I suggest that we keep 'module/model' as the documented preferred convention, but for compatibility, try 'module.model' if no translation is found under 'module/model'. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.