0

I have a form, and the validation looks like the following:

Create
 - Nom/titre de votre objet doit être rempli(e)
 - Catégorie doit être rempli(e)
 - Description doit être rempli(e)

I would like to translate Create into something else. How can I do that ?


I am guessing I can add something like this in fr.yml:

activerecord:
    actions:
      create: "Création"
      update: "Mise à jour"        

But that doesn't work. Is it possible that way ? How can I find the list of all translation keys that I can specify to active record ? I do not find it in the documentation.

Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115
Benjamin Crouzier
  • 40,265
  • 44
  • 171
  • 236

2 Answers2

0

I don't understand your question clearly.How ever You can try this.

In config/routes.rb

match "controller/Création" => "controller#Créate" 
Inaccessible
  • 1,560
  • 3
  • 18
  • 42
  • I just want to translate the name of my action, not refactor my code. I don't want to use non-ascii characters either. And I don't want to use non-resourcefull routes. – Benjamin Crouzier Jun 04 '13 at 11:48
  • You want to display as "Création" instead of "create"in url right? If yes you can use this. – Inaccessible Jun 04 '13 at 11:53
0

You already have a gem that can do this work for you. Take a look at rails-translate-routes and check their examples.

You can try Dynamic Segments as explained in Rails Routing from the Outside In, if you want to create it by hand.

Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115