Hello!
This is probably something easy. I’ve looked at some documentation but
I didn’t find any good resources on how to change to default locale
file with Devise authentication plugin. Should I do it in my
application controller or should I change something in Devise? And how
should I do it.
Thanks
// Anders
Sorry, perhaps I misunderstood you. But do you mean something like this?
config.i18n.default_locale = :de
This is in application.rb (rails3) and has nothing specific to do with
Devise itself.
Sorry
I think I needed a second thought to understand your question.
You want to change the content of the devise-locale-files?
Get the files you need, put them into config/locales and change them,
however you need them.
Oh sorry, me again. g There was a third thought.
Do you want to change something in views? Last time I used Devise, text
in views was hard coded. (I think
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
<div class="field">
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i></p>
<p><%= f.password_field :password, autocomplete: "new-password" %></p>
<% if @minimum_password_length %>
<p><em><%= @minimum_password_length %> characters minimum</em></p>
<% end %>
This file has been truncated. show original
shows, it’s still the same.)
rails generate devise:views
Then you can edit the views in app/views/devise