2010-08-12 5 views

risposta

7

Prova questo nel file yml (config/locales/PT-BR.yml nel mio caso):

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

ha lavorato per me, utilizzando 2.0.0.beta.17 mongoid e rotaie 3.0.0

+2

Che dire della traduzione del nome del modello stesso? –

+0

Funziona perfettamente con mongoid 2.7.1 !! – cortex

14

La variante con "activemodel" non funziona per me. Ma.

Questa variante ha funzionato per me:

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

Problemi correlati