gpt4 book ai didi

ruby-on-rails - 翻译设计登录链接

转载 作者:行者123 更新时间:2023-12-01 21:56:55 26 4
gpt4 key购买 nike

我使用此链接将登录链接放在我的应用程序上:

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

我要求 Rails 默认使用法语:

 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>

上面写着“记住我”,但我想要法语翻译。

我做错了什么?

谢谢

最佳答案

在 Rails 3 中,您将需要以下结构的它:

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

这个blog postthis one应该会有帮助。

关于ruby-on-rails - 翻译设计登录链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8869510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com