I spent the rest of today building with this behavior.  For every
string I created a short string that is easy to translate.
Example:
My cancel button as_('cancel_button')
the en.yml holds
cancel_button: "Cancel"

If you create a new project under Rails 2.2, you'll get the config/
locales/en.yml
if you want, here is the first few lines of mine.

# Sample localization file for English. Add more files in this
directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale
for starting points.

en:
  hello: "Hello world"

  active_scaffold:
    cancel_button: "Cancel"



If you find a string that does not get caught by the missing
translation error, simply enclose the string inside as_()
Example
<%= link_to 'Done' ...
Change to
<%= link_to as_('done') ...
Add the following to en.yml
done: "Done"

Makes a perfectly translatable application.
Good luck.
Kent


On Feb 20, 2:22 pm, chris <[email protected]> wrote:
> I don't have a file called en.yml or a locals folder in config. Is
> this just a matter of creating the folder and file and using your code
> or is this file more complicated then that.
>
> Thank you for your help!
>
> On Feb 20, 2:15 pm, cntrytwist <[email protected]> wrote:
>
> > 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?
>
> > 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

  • St... chris
    • ... cntrytwist
      • ... cntrytwist
        • ... Tys von Gaza
        • ... chris
          • ... cntrytwist
            • ... Wes Gamble
              • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
              • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
        • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
          • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.

Reply via email to