Hi Sven, sorry for the late reply. Yes, I'm talking about validation messages. It should be Konnte diese Akte nicht speichern: 2 Fehler but instead it is Konnte diese file item nicht speichern: 2 Fehler Note that "file item" has no underscore in the message! But in the YML and in the file name itself - file_item.rb - it does have an underscore of course.
I looked into this a bit and it seems that activerecord/base.rb human_name is never called. I edited it to always return "Bla", but that didn't change anything. Changing human_attribute_name to always return "Bla", did work, however. I was under the impression that human_name is called here: http://github.com/rails/rails/tree/master/activerecord/lib/active_record/validations.rb#L104 But when I change :model => @base.class.human_name, to :model => "Bla", it dosen't make a difference, either. weird! - Johannes On Nov 18, 3:40 pm, Erik Dahlstrand <[EMAIL PROTECTED]> wrote: > I have the exact same problem. > > Example: > > app/models/news_item.rb > class NewsItem < ActiveRecord::Base > end > > app/locales/activerecord_sv.yml > sv: > activerecord: > models: > news_item: > one: "Nyhet" > many: "Nyheter" > > error_messages_for generates... > > "3 fel: news item kunde inte sparas." > > should be... > > 3 fel: Nyhet kunde inte sparas. > > The attributes for "underscore models" are translated correctly. The > names for models with no underscore file names are also translated > correctly. > > /Erik > > On 17 Nov, 20:12, Sven Fuchs <[EMAIL PROTECTED]> wrote: > > > Hi Johannes, > > > am I right that your model classes have camelcased names like > > FileItem, AccessGroup etc? > > > Can you provide some more context about what exactly you are doing? > > Are you talking about validation messages? Or something else? > > > This is the line where ActiveRecord validations look up the messages > > with various default keys: > > >http://github.com/rails/rails/tree/master/activerecord/lib/active_rec... > > > On 07.11.2008, at 16:35, Johannes Fahrenkrug wrote: > > > > Hi, > > > > I have a problem: model names with underscores are not picked up from > > > the locale yml file: > > > > de: > > > activerecord: > > > models: > > > file_item: "Akte" > > > category: Kategorie > > > access_group: Zugriffsgruppe > > > responsible_person: Zustaendige(r) > > > user: Benutzer > > > attributes: > > > file_item: > > > title: Titel > > > > category become "Kategorie", but file_item doesn't become "Akte". the > > > attributes, however, work: "title" becomes Titel. > > > Do you have any suggestions for a workaround/fix? > > > > Thanks! > > > > - Johannes > > > -- > > >http://springenwerk.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "rails-i18n" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rails-i18n?hl=en -~----------~----~----~----~------~----~------~--~---
