diff --git a/app/controllers/discourse_controller.rb b/app/controllers/discourse_controller.rb
index 80ea755d..b215554a 100644
--- a/app/controllers/discourse_controller.rb
+++ b/app/controllers/discourse_controller.rb
@@ -6,7 +6,7 @@ class DiscourseController < ApplicationController
def sso
if !current_user
session[:discourse_url] = request.url
- redirect_to new_ui_session_path(goto: request.path), notice: 'Please Log In before using SSO'
+ redirect_to new_ui_session_path(goto: request.path), notice: I18n.t(:login_before_sso_notice)
return
end
secret = DISCOURSE_SSO_SECRET
diff --git a/app/controllers/ui/sessions_controller.rb b/app/controllers/ui/sessions_controller.rb
index faea7aba..34729b5a 100644
--- a/app/controllers/ui/sessions_controller.rb
+++ b/app/controllers/ui/sessions_controller.rb
@@ -6,7 +6,7 @@ class SessionsController < ApplicationController
require 'net/https'
def new
- @title = "Welcome!"
+ @title = I18n.t(:new_session_title)
redirect_to ui_users_url if current_user
end
@@ -29,11 +29,11 @@ def create
if params[:goto].include? 'discourse'
redirect_to session[:discourse_url]
else
- flash[:success] = "You have been successfully logged in!"
+ flash[:success] = I18n.t(:new_session_success)
redirect_to (session[:user_return_to] || ui_users_path)
end
else
- flash.now.alert = "Email or password is invalid"
+ flash.now.alert = I18n.t(:new_session_failure)
render "new"
end
end
@@ -46,11 +46,11 @@ def reset_password_email
authorize user, :request_password_reset?
user.send_password_reset
end
- flash[:notice] = 'Please check your email to reset the password.'
+ flash[:notice] = I18n.t(:password_reset_notice)
end
def password_reset_landing
- @title = "Change password"
+ @title = I18n.t(:password_reset_landing_title)
@token = params[:token]
end
@@ -58,7 +58,7 @@ def change_password
@token = params.require(:token)
if params.require(:password) != params.require(:password_confirmation)
- flash[:alert] ="Your password doesn't match the confirmation"
+ flash[:alert] = I18n.t(:password_reset_failure)
render "password_reset_landing"
return
end
@@ -67,17 +67,17 @@ def change_password
if @user
authorize @user, :update_password?
@user.update({ password: params.require(:password), password_reset_token: nil })
- flash[:success] = "Changed password for: #{@user.username}"
+ flash[:success] = I18n.t(:password_reset_success, username: @user.username)
redirect_to new_ui_session_path
else
- flash[:alert] = 'Your reset code might be too old or have been used before.'
+ flash[:alert] = I18n.t(:password_reset_invalid)
render "password_reset_landing"
end
end
def destroy
session[:user_id] = nil
- redirect_to login_url, notice: "Logged out!"
+ redirect_to login_url, notice: I18n.t(:destroy_session_success)
end
end
end
diff --git a/app/controllers/ui/users_controller.rb b/app/controllers/ui/users_controller.rb
index d256ccfe..08a68483 100644
--- a/app/controllers/ui/users_controller.rb
+++ b/app/controllers/ui/users_controller.rb
@@ -2,7 +2,7 @@ module Ui
class UsersController < ApplicationController
include SharedControllerMethods
def index
- @title = "User information"
+ @title = I18n.t(:users_index_title)
end
end
end
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index b0ac312e..0f623b13 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -2,30 +2,30 @@
-
" alt="Smart Citizen">
+
" alt="<%= t :footer_logo_alt %>">
-
A project by
+
<%= t :footer_attribution %>
-
" alt="Fablab BCN" />
+
" alt="<%= t :footer_fablab_alt %>" />
-
" alt="IAAC">
+
" alt="<%= t :footer_iaac_alt %>">
@@ -35,13 +35,13 @@
" alt="" />
-
Smart Citizen has received funding from the
European Community’s H2020 Programme
under Grant Agreement No. 689954.
+
<%= t :footer_funding_html %>
-
Except where otherwise noted, content on this site by Smart Citizen® is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Check the Terms of use and Privacy Policy.
+
<%= t :footer_licence_html %>
diff --git a/app/views/layouts/_nav.html.erb b/app/views/layouts/_nav.html.erb
index b13356d6..78d950d7 100644
--- a/app/views/layouts/_nav.html.erb
+++ b/app/views/layouts/_nav.html.erb
@@ -1,24 +1,24 @@