El Friday 20 February 2009 20:15:14 cntrytwist escribió:
> Ok, here's what I've been able to figure out. I don't know if this is
> a bug or by design, but it appears that something, either Rails or
> ActiveScaffold is attempting to translate the strings used in
> config.
> Your example Chris is:
> columns[:firstname].label = "First Name"
>
> So, in your config/locals/en.yml you need to place the following:
> active_scaffold:
> 'First Name': "First Name"
>
> Do that with every string you give and the error goes away. At first
> it does appear to more than double the efforts, but if you ever have
> to localize, it sure makes it easier. Maybe we need to consider what
> we use for those strings, and try something generic that would be
> shorter and descriptive. Then in the translation file give what we
> really want it to say?
>
Really, you don't need to set label in the controller, you can change column
name directly in locales file, also errors from rails validations will use
that string as column name.
config/locales/em.yml
en:
activerecord:
models:
attributes:
model_name:
firstname: 'First Name'
other_model:
column: 'Text for column'
Anyway, I can change label method for column and don't translate anything you
set, or translate only symbols, and leave strings as you set. What do you
think?
> Just a thought.
> Kent
>
> On Feb 20, 11:35 am, cntrytwist <[email protected]> wrote:
> > I'm having the same issue. I suspect it has to do with the config/
> > locals/en.yml and how AS picks up on it.
> > Would it be too much trouble for someone in the know to give a little
> > note here on how we're supposed to enable or disable translations? I
> > don't need translation, but I'm sure others will.
> > Thanks a million for the help.
> >
> > On Feb 20, 9:32 am, chris <[email protected]> wrote:
> > > I upgraded my app to Rails 2.2 and updated active_scaffold
> > > accordingly. Everything appears to work fine with the exception of
> > > where I changed the field labels in the forms and table. For example:
> > >
> > > columns[:firstname].label = "First Name"
> > >
> > > When this displays in my table, I now see the following:
> > >
> > > translation missing: en, active_scaffold, First Name
> > >
> > > Any idea what is going on?
> > >
> > > Thank you,
> > > Chris
>
>
--
Sergio Cambra .:: entreCables S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---