Edson, I think that your problem isn't i18n or translation.

Your problem is with the default name of the Model.

Try to add the name in your sexo.rb model: Hobo doesn't know which
field of the model you want to use as default name.

  fields do
    sexo :string, :name => "True"
    timestamps
  end


or you can add the following:

def name
 self.sexo
end


best regards,
eddie.


On May 17, 2:06 pm, Edson <[email protected]> wrote:
> i eddie,
>
> i'll give it a try.
>
> my last post i forgot to attach the prints for "
> config.hobo.show_translation_keys = true".
>
> well here it goes.
>
> thank you.
>
> edson
>
> Em quinta-feira, 17 de maio de 2012 09h08min57s UTC-1, Edson escreveu:
>
>
>
>
>
>
>
>
>
> > hi eddie,
>
> > thank you for the reply.
>
> > i have a has_many/belongs_to relationship between my cadastro table and
> > some others (like sexo).
>
> > but as you can see on the screenshot, when i create a new value for sexo
> > table on the sexo index page i get the Sexo 1 value instead of "Masculino"
> > that is the real value i've put on the table.
>
> > The same happens on the cadastro table when i try to select the sexo value
> > "Masculino". It appears Sexo 1.
>
> > The cadastro code:
> > class Cadastro < ActiveRecord::Base
>
> >   hobo_model # Don't put anything above this
>
> >   fields do
> >     nome        :string
> >     alcunha     :string
> >     n_doc       :string, :unique
> >     local_nasc  :string
> >     dt_nasc     :date
> >     nome_conj   :string
> >     ndoc_conj   :string, :unique
> >     ender_resid :string
> >     tem_resid   :string
> >     tel_fixo    :integer, :unique
> >     tel_mvl     :integer, :unique
> >     tel_vizinho :integer, :unique
> >     nm_pai      :string
> >     nm_mae      :string
> >     refere      :string
> >     num_agrefam :integer
> >     num_filho   :integer
> >     timestamps
> >   end
> > belongs_to :est_civil
> > belongs_to :sexo
> > belongs_to :nacionalidade
> > belongs_to :bairro
> > belongs_to :cidade
> > belongs_to :ilha
> > belongs_to :tp_resid
> > belongs_to :escolaridade
>
> > the sexo code:
> > class Sexo < ActiveRecord::Base
>
> >   hobo_model # Don't put anything above this
>
> >   fields do
> >     sexo :string
> >     timestamps
> >   end
> > has_many :cadastros, :dependent => :destroy
>
> > i hope this help
>
> > thank you all
>
> > Em quarta-feira, 16 de maio de 2012 19h25min19s UTC-1, erbecke escreveu:
>
> >> I agree with Ignacio.
>
> >> Please tell us how did you configure i18n in your application
> >> controller and your site.
>
> >> If you set a YML language file, then you may use as many languages as
> >> you want, each language in a different file setting it with the
> >> I18n.locale variable.
>
> >> In my web-app, each user can choose which language they want to use
> >> (current_user.language).
>
> >> ---- application_controller.rb
> >> ...
>
> >>  before_filter :set_locale
>
> >>   def set_locale
> >>     # update session if logged
> >>     if current_user.to_s != "guest"
> >>       session[:locale] = current_user.language.to_s
> >>     end
>
> >>     # read url locale param or default_locale for guest users
> >>     if current_user.to_s == "guest"
> >>       session[:locale] = params[:locale] #I18n.default_locale
> >>     end
>
> >>     # set locale based on session or default
> >>      I18n.locale = session[:locale] || I18n.default_locale
>
> >>   end
>
> >> -----
>
> >> best regards,
>
> >> eddie.
>
> >> On May 16, 4:35 pm, Ignacio Huerta <[email protected]> wrote:
> >> > -----BEGIN PGP SIGNED MESSAGE-----
> >> > Hash: SHA1
>
> >> > Hi Edson,
>
> >> > We are working with 1.3 we have several spanish only and some
> >> > spanish+english applications (for examplehttp://www.islandiacar.com).
> >> > I suppose the problem lies with the translation file format.
>
> >> > Can you provide us with more detailed information about the error?
> >> > Some code or screenshots would be great. I would like to reproduce it
> >> > locally if I can.
>
> >> > On the other side, have you tried setting "
> >> > config.hobo.show_translation_keys = true" on application.rb and
> >> > restarting your application? It helps a lot to debug i18n problems.
>
> >> > Regards,
> >> > Ignacio
>
> >> > El 15/05/12 23:45, Edson escribi�:
>
> >> > > hi eddie,
>
> >> > > I only this issue with pt-PT , but when i start a new app and
> >> > > configure (hobo g setup_wizard) the language to en i don't have
> >> > > this problem.
>
> >> > > My question is: is there possible to have multiple languages?  if
> >> > > yes, how?
>
> >> > > And if i have pt-PT and en-US at my config i'll solve my issue?
>
> >> > > thank you,
>
> >> > > edson
>
> >> > > On 15 maio, 20:03, erbecke <[email protected]> wrote:
> >> > >> hmm... I'm still under Rails 2.3 / Hobo 1.0, and I never had
> >> > >> this problem.
>
> >> > >> But... I don't understand why it only happens with your pt-PT
> >> > >> language.
>
> >> > >> Do you have only one language? You said that you faven't that
> >> > >> problem in english.
>
> >> > >> Your app use a en-US yml file? or english is your default
> >> > >> language without using a YML file for it?
>
> >> > >> Have you tried to use another language option, for example es-SP
> >> > >> at least with a blank language file?
>
> >> > >> (in order to determine if the problem is your YML language file,
> >> > >> your default settings, or whatever)
>
> >> > >> Best regards, Eddie.
>
> >> > >> On May 15, 1:40 am, Edson <[email protected]> wrote:
>
> >> > >>> ohh, i forgot
>
> >> > >>> i'm using postgresql also.
>
> >> > >>> thank you
>
> >> > >>> edson
>
> >> > >>> On 15 maio, 02:40, Edson <[email protected]> wrote:
>
> >> > >>>> hi eddie, first off all thank you for your reply.
>
> >> > >>>> i'm using rails 3.0.9 and hobo 1.3.0.
>
> >> > >>>> it happens with all the values for all my entire app, but for
> >> > >>>> the user model.
>
> >> > >>>> wich .yml you mean. in my application.rb i have
> >> > >>>> config.encoding = "utf-8".
>
> >> > >>>> thank you,
>
> >> > >>>> edson.
>
> >> > >>>> On 14 maio, 19:47, erbecke <[email protected]> wrote:
>
> >> > >>>>> hm... do you have the same problem with every value ? or
> >> > >>>>> just with one?
>
> >> > >>>>> are you using hobo with rails 2.3 or 3.x?
>
> >> > >>>>> check your .yml file, perhaps there is something bad.
>
> >> > >>>>> and check out your file encondig. You should use UTF-8
>
> >> > >>>>> eddie.
>
> >> > >>>>> On May 14, 12:36 pm, Edson <[email protected]>
> >> > >>>>> wrote:
>
> >> > >>>>>> Hi everybody,
>
> >> > >>>>>> Is there any post related to this that i can try?
>
> >> > >>>>>> I can not find i way to make this work.
>
> >> > >>>>>> Any kind of help will be helpful.
>
> >> > >>>>>> Thank you in advance.
>
> >> > >>>>>> Edson Teixeira
>
> >> > >>>>>> On 7 maio, 18:32, Edson <[email protected]> wrote:
>
> >> > >>>>>>> Hi everybody,
>
> >> > >>>>>>> I'm workin on an app locale pt-PT and when i create my
> >> > >>>>>>> relationship between tables the values don't show up
> >> > >>>>>>> correctly:
>
> >> > >>>>>>> i have table 1
>
> >> > >>>>>>> has_many :table2
>
> >> > >>>>>>> but the value that apear is just Value1, instead of
> >> > >>>>>>> appear the information that corresponds to "Value1".
>
> >> > >>>>>>> Is there somethin that i'm doing wrong.
>
> >> > >>>>>>> I've tried on en app localization and it works fine.
>
> >> > >>>>>>> Thank you in advance
>
> >> > >>>>>>> Edson Teixeira
>
> >> > - --
> >> > Ignacio Huerta Artechehttp://www.ihuerta.net
> >> > Tel�fono: 0034 645 70 77 35
> >> > Email realizado con software libre
> >> > -----BEGIN PGP SIGNATURE-----
> >> > Version: GnuPG v1.4.10 (GNU/Linux)
> >> > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> >> > iEYEARECAAYFAk+0AY4ACgkQBPlUJ6RHaOTruwCfbOrPFaZYa3HrYXR8jsoYzvlE
> >> > UJ4AniGlPdHxPHPCZsMBBNBNmBKHjOtl
> >> > =J49Y
> >> > -----END PGP SIGNATURE-----
>
>
>
>  sexo_index1.png
> 34KViewDownload
>
>  novo_cadastro1.png
> 98KViewDownload

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to