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
-~----------~----~----~----~------~----~------~--~---

Reply via email to