Oh an to be complete about the first thing: I know I can get the
controller/action translations by doing
t('controller.action.translation'), but I'd like to integrate my
localisation more into my application. Of course I could write a
method to extend t(), but I've done stuff like that before only to
find out Rails already has functionality for it. I just don't know
where it is.On 20 apr, 17:24, jhaagmans <[email protected]> wrote: > Hi, > > I have some trouble using Il8n. I've had these problems for a while > now and always used rough workarounds, but as my productivity needs to > go up another notch, I was wondering whether there was any way of > avoiding these workarounds. > > For example: When I'm inside a view (say 'home/index') and use > t('title'), I'd like Rails to know I'm looking for the last line in > this en.yml file: > --- > en: > home: > index: > title: "Home" > --- > I've achieved this by using a plugin, but the plugin doesn't always do > the trick (for example, it can't be used in a layout file). Is my > piece of YAML above correct? And should it work? > > Also, I'd like to be able to set a default title that can be > overridden by defining it in a controller action translation. So there > should also be a "base" title variable. > > Furthermore, I'd also like Rails to know that, when I do this: > > <% form_for @user do |f| %> > <%= f.label :name %> > <%= f.text_field :name %> > <%- end -%> > > It should look for the following translation to use as the label > value: > --- > en: > activerecord: > attributes: > user: > name: "Full Name" > ---- > Why isn't it doing this? Isn't that what Il8n was meant to do? > > I'm probably making mistakes, so feel free to point out to me where > I'm making them. > > Thank you in advance! > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" 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 > athttp://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.

