diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7ace4ad..811d81f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -28,8 +28,14 @@ end end - def I18n_constant(string) - I18n.t("magic_strings.#{string}", locale: I18n.default_locale) + ## + # takes in a string which is meant to be constant, and looks it up in the default + # (en-UK) locale. This should ensure that the back-end remains constant and consistantly called + # + # @param String constant the string which will be looked up in the localisation + # @return String the constant which the string defines + def I18n_constant(constant) + I18n.t("magic_strings.#{constant}", locale: I18n.default_locale) end # Added setting for passing local params across pages diff --git a/app/views/dmptemplates/admin_phase.html.erb b/app/views/dmptemplates/admin_phase.html.erb index 090e384..fae3142 100644 --- a/app/views/dmptemplates/admin_phase.html.erb +++ b/app/views/dmptemplates/admin_phase.html.erb @@ -41,7 +41,7 @@ <% if @edit == "false" || (@phase.dmptemplate.org_type == I18n_constant("organisation_types.funder") && current_user.org_type != I18n_constant("organisation_types.funder")) then%> <%= render :partial => 'show_version', locals: {version: @version}%> - <%elsif @edit == "true" || current_user.org_type == t("helpers.org_type.funder") then %> + <%elsif @edit == "true" || current_user.org_type == I18n_constant("organisation_types.funder") then %> <%= render :partial => 'edit_version', locals: {version: @version, edit: @edit, phase: @phase} %> <%end%> diff --git a/config/locales/en-UK.yml b/config/locales/en-UK.yml index ed24232..75b5a0d 100644 --- a/config/locales/en-UK.yml +++ b/config/locales/en-UK.yml @@ -167,7 +167,6 @@ user_org_updated: 'User org role was successfully updated.' api_privleges: 'API Privleges?' is_org_admin: 'Is Org Admin?' - guidance: guidance_list: "Guidance list"