diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 8394971..da3827b 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -704,11 +704,11 @@ float:left; } -#s2id_user_organisation_id{ +#s2id_user_organisation_id, #s2id_user_language_id { min-width:84% !important; clear:both; float:left; - margin: 0 0 10px 0; + margin: 0 0 5px 0; } #other-org-link { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7160fd7..182ee9a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -18,17 +18,18 @@ def set_locale # parameter from url takes precedence - if params[:locale] + # check if locale is defined + if params[:locale] # and I18n.available_locales.include? params[:locale] # throw an error if not available # if locales data is present in the parameter from url use it - # TODO we need to error to the user that locale is missing, it can be THE CASE because there can be a missmatch between locales files and db I18n.locale = params[:locale] - elsif false # TODO + elsif user_signed_in? and !current_user[:language_id].nil? + I18n.locale = Language.find_by_id(current_user[:language_id]).name # if user has set preferred language use it elsif false # TODO # use user's organization language, keep in mine the "OTHER ORG" edge case which should use english else # just use the default language, line can be commented out, included just for clarity - # I18n.locale = config.I18n.default_locale + I18n.locale = I18n.default_locale end end diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 08843f2..ae9e85a 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -1,4 +1,7 @@ -class ContactsController < ContactUs::ContactsController +class ContactsController < ContactUs::ContactsController + + # in order to i18 this file recaptcha gem has to be updated + def create @contact = ContactUs::Contact.new(params[:contact_us_contact]) if (!user_signed_in?) diff --git a/app/models/user.rb b/app/models/user.rb index 9edea25..fc7a9eb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,6 +16,7 @@ has_many :project_groups, :dependent => :destroy has_many :organisations , through: :user_org_roles has_many :user_role_types, through: :user_org_roles + has_one :language @@ -49,7 +50,8 @@ attr_accessible :password_confirmation, :encrypted_password, :remember_me, :id, :email, :firstname, :last_login,:login_count, :orcid_id, :password, :shibboleth_id, :user_status_id, :surname, :user_type_id, :organisation_id, :skip_invitation, - :other_organisation, :accept_terms, :role_ids, :dmponline3, :api_token + :other_organisation, :accept_terms, :role_ids, :dmponline3, :api_token, + :language_id # FIXME: The duplication in the block is to set defaults. It might be better if # they could be set in Settings::PlanList itself, if possible. diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index b9b67e1..fb4b07c 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,14 +1,14 @@
<%= raw t("helpers.user_details_paragraph_html")%>
+<%= raw t("helpers.user_details_paragraph_html") %>