diff --git a/.idea/Rorbua.iml b/.idea/Rorbua.iml index 2e05166..a3755b2 100644 --- a/.idea/Rorbua.iml +++ b/.idea/Rorbua.iml @@ -26,113 +26,113 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 66c92f5..e1f2bd8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,6 @@ class ApplicationController < ActionController::Base before_action :configure_permitted_parameters, if: :devise_controller? - #before_action :set_locale + before_action :set_locale protected @@ -11,8 +11,7 @@ class ApplicationController < ActionController::Base end def set_locale - I18n.locale = params[:locale] || session[:locale] || I18n.default_locale - session[:locale] = I18n.locale + I18n.locale = session[:locale] || I18n.default_locale end def after_sign_up_path_for(resource) diff --git a/app/controllers/languages_controller.rb b/app/controllers/languages_controller.rb index e32e62c..5d40626 100644 --- a/app/controllers/languages_controller.rb +++ b/app/controllers/languages_controller.rb @@ -1,18 +1,12 @@ class LanguagesController < ApplicationController - before_action :set_language, only: %i[ show edit update destroy ] # POST /languages or /languages.json def change - puts "CCCCCCCCCCCCCCCCCCCCC #{params[:set_locale]}" - session[:locale] = I18n.locale = params[:set_locale] + session[:locale] = I18n.locale = params[:locale] redirect_back(fallback_location: root_path) end private - # Use callbacks to share common setup or constraints between actions. - def set_language - @language = Language.find(params[:id]) - end # Only allow a list of trusted parameters through. def language_params diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 469ed22..3ebc316 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -6,7 +6,7 @@ <%= form_for(resource, as: resource_name, data: { turbo: false}, url: registration_path(resource_name), html: { method: :put }) do |f| %>
- <%= f.label :user_image, "Profilbilde", class: "form-label" %> + <%= f.label :user_image, t(".profile_picture") , class: "form-label" %> <%= f.file_field :user_image, class: "form-control" %> <%= error_message_on(f.object, :user_image) %>
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index c59cfcd..7b6bbbb 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -19,7 +19,7 @@
<%= f.label :password, t(".password") %>
- <%= f.password_field :password, autocomplete: "new-password", class: "form-control",placeholder: "#{@minimum_password_length} tegn minimum" %> + <%= f.password_field :password, autocomplete: "new-password", class: "form-control",placeholder: "#{@minimum_password_length} #{t(".letters_minimum")}" %> <%= error_message_on(f.object, :password) %>
diff --git a/app/views/languages/_form.html.erb b/app/views/languages/_form.html.erb deleted file mode 100644 index bdb12d2..0000000 --- a/app/views/languages/_form.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<%= form_with(model: language) do |form| %> - <% if language.errors.any? %> -
-

<%= pluralize(language.errors.count, "error") %> prohibited this language from being saved:

- -
    - <% language.errors.each do |error| %> -
  • <%= error.full_message %>
  • - <% end %> -
-
- <% end %> - -
- <%= form.text_field :name, style: "width: 100px" %> - <%= form.submit "Set language "%> -
-<% end %> diff --git a/app/views/layouts/_language_selector.html.erb b/app/views/layouts/_language_selector.html.erb index c719a75..99ecfb0 100644 --- a/app/views/layouts/_language_selector.html.erb +++ b/app/views/layouts/_language_selector.html.erb @@ -1,7 +1,6 @@ - - diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb index cb6878f..ce84cad 100644 --- a/app/views/layouts/_navbar.html.erb +++ b/app/views/layouts/_navbar.html.erb @@ -7,7 +7,7 @@