我在我的法语Rails项目中工作,但我想为Rail-admin使用的authenticate_or_request_with_http_basic设置英语语言。它目前以法语显示。如何将语言设置为英语?
我尝试使用gem 'rails-i18n'设置区域设置。但它没有任何效果。
app/config/initializers/rails-admin.rb
config.authenticate_with do
authenticate_or_request_with_http_basic('Login required') do |username, password|
admin = Admin.where(name:username).first
admin.authenticate(password) if admin
end
end发布于 2019-05-04 16:25:57
登录提示/对话框构建在浏览器中,不能由服务器(Rails)更改。
只需尝试更改打开rails应用程序的机器的区域设置,您将看到根据语言设置的提示。
https://stackoverflow.com/questions/55976263
复制相似问题