2012-01-15 11 views
3

をリンク翻訳:工夫ログインが私は自分のアプリケーションのログインのリンクを置くために、このリンクを使用し

https://github.com/plataformatec/devise/wiki/How-To:-Add-sign_in,-sign_out,-and-sign_up-links-to-your-layout-template 

私もフランス語翻訳ファイルを追加します

https://gist.github.com/871074 

を、私はフランス語を使用するようにレールを頼みますデフォルトとして:

config.before_configuration do 
    I18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s] 
    I18n.locale = :fr 
    I18n.default_locale = :fr 
    config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s] 
    config.i18n.locale = :fr 
    # bypasses rails bug with i18n in production\ 
    I18n.reload! 
    config.i18n.reload! 
end 

config.i18n.locale = :fr 
config.i18n.default_locale = :fr 

しかし、私のボタン/ラベルが翻訳されていないため。

<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> 

"私を覚えています"と書いてありますが、私はフランス語の翻訳が欲しいです。

どうしたのですか?

はあなたにレール3に

答えて

10

をありがとう、あなたは次のような構造で、それが必要になります。

fr: 
    helpers: 
    label: 
     user: 
     remember_me: French text here! 

このblog postthis oneが参考になるはずです。

6

加えて、以下の行を追加することができます。

fr: 
    activerecord: 
    attributes: 
     user: 
     remember_me: text 
関連する問題