Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I18n of submit in Ruby on Rails

I have trying to add internationalization to my Rails app. I've read rails guides and all parts of app was internationalized successfully except Submit button. Actually I've translated it partially. Looked at source code of submit method, I've read commentary before declaration of the method. There is part from that commentary:

 en:
   helpers:
     submit:
       create: "Create a %{model}"
       update: "Confirm changes to %{model}"

I've used that example in my config/locales/??.yml files. And have a trouble to translate %{model}. Name of my Model always in english.

How can I translate it?

like image 572
ck3g Avatar asked Feb 03 '11 17:02

ck3g


1 Answers

You can translate specific model names like this, eg for es.yml:

es:
  activerecord:
    models:
      my_model_name: new_model_name
like image 113
Zabba Avatar answered Oct 24 '22 04:10

Zabba