Formatting for I18n

How does the formatting in e g en.yml for I18n works? Are these 4
examples the same?

–1
en:
hello: Hello

–2
en:
hello: Hello

–3
en:
hello: Hello

–4
en:

hello: Hello

Never mind. I understand that I should not use tab.

I can make it work sometimes, but then it doesn’t. It seems to be
extremely sensitive. What do I do wrong?

I use TextMate. Any tips of how to write YAML?

It works if I add this in en.yml.

errors:
template:
body: “”
header:
one: “”
other: “”
messages:
too_short: “is too short (minimum is {{count}}
characters)”

But not in se.yml (the exact same stuff). I get:

Username translation missing:
se.activerecord.errors.models.user.attributes.username.too_short

How do I add this to se.yml?

Username translation missing:
se.activerecord.errors.models.user.attributes.username.too_short

zindelo wrote in post #990018:

You might want to have a look at:

indentation requirements

http://www.yaml.org/spec/1.2/spec.html#Basic

i18n with active record

http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models

example locale files, including active record errors

https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale

Thanks. It helped a bit. But…why is this so hard??

I’ve installed the plugin dynamic_form. Do I add this in that en.yml or
in the deafult one? If I change body: in the first one it works. But
nothing happen when I add messages:

You might want to have a look at:

indentation requirements

http://www.yaml.org/spec/1.2/spec.html#Basic

i18n with active record

http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models

example locale files, including active record errors

https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs