2010-08-12 11 views

Respuesta

7

Prueba esto en el archivo yml (config/lugares/pt-BR.yml en mi caso):

activemodel: 
    attributes: 
     [model_name]: 
     [attribute1]: "[translation1]" 
     [attribute2]: "[translation2]" 
     [attribute3]: "[translation3]" 

trabajado para mí, usando 2.0.0.beta.17 MongoId y carriles 3.0.0

+2

¿Qué hay de traducir el nombre del modelo en sí? –

+0

Funciona perfecto con mongoid 2.7.1 !! – cortex

14

Variante con "activemodel" no funciona para mí. Pero.

Esta variante funcionó para mí:

en: 
    mongoid: 
    errors: 
     models: 
     user: 
      attributes: 
      email: 
       blank: "You have to give me your e-mail address" 
       not_found: "e-mail address not found in list of members" 
       #... 
    attributes: 
     user: 
     email: "Email address" 
     name: "Your nickname" 
     #... 

From here

Cuestiones relacionadas