Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#44146] moved locale keys to module constants

Eric Schubertfe3433974c89
diff --git a/modules/storages/app/constants/storages/admin.rb b/modules/storages/app/constants/storages/admin.rb
new file mode 100644
index 00000000000..b5ec4f00c19
--- /dev/null
+++ b/modules/storages/app/constants/storages/admin.rb
@@ -0,0 +1,34 @@
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) 2012-2022 the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Admin
+ LABEL_OAUTH_CLIENT_ID = 'OAuth Client ID'.freeze
+ LABEL_OAUTH_CLIENT_SECRET = 'OAuth Client Secret'.freeze
+ end
+end
diff --git a/modules/storages/app/views/storages/admin/storages/edit.html.erb b/modules/storages/app/views/storages/admin/storages/edit.html.erb
index 6f681051642..b6a4a6be468 100644
--- a/modules/storages/app/views/storages/admin/storages/edit.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/edit.html.erb
@@ -18,13 +18,13 @@
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend">OpenProject <%= t(:'storages.label_oauth_application_details') %></legend>
<div class="attributes-key-value">
- <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_id') %></div>
+ <div class="attributes-key-value--key">OpenProject <%= Storages::Admin::LABEL_OAUTH_CLIENT_ID %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span><%= @object.oauth_application.uid %></span>
</div>
</div>
- <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_secret') %></div>
+ <div class="attributes-key-value--key">OpenProject <%= Storages::Admin::LABEL_OAUTH_CLIENT_SECRET %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span>●●●●●●●●●●●●●●●●</span>
@@ -44,13 +44,13 @@
<legend class="form--fieldset-legend"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= t(:'storages.label_oauth_client_details') %></legend>
<% if @object.oauth_client %>
<div class="attributes-key-value">
- <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= t(:'storages.label_oauth_client_id') %></div>
+ <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= Storages::Admin::LABEL_OAUTH_CLIENT_ID %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span><%= @object.oauth_client.client_id %></span>
</div>
</div>
- <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= t(:'storages.label_oauth_client_secret') %></div>
+ <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= Storages::Admin::LABEL_OAUTH_CLIENT_SECRET %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span><%= short_secret(@object.oauth_client.client_secret) %></span>
diff --git a/modules/storages/app/views/storages/admin/storages/new.html.erb b/modules/storages/app/views/storages/admin/storages/new.html.erb
index 479a1e98609..a43acecf182 100644
--- a/modules/storages/app/views/storages/admin/storages/new.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/new.html.erb
@@ -10,6 +10,5 @@
<% else %>
<%= styled_button_tag t("storages.buttons.save_and_continue_setup"), class: "-highlight -with-icon icon-checkmark" %>
<% end %>
- <%= link_to t("storages.buttons.cancel"), admin_settings_storages_path, class: 'button -with-icon icon-close' %>
- <%#= styled_button_tag t("storages.buttons.cancel"), class: "-with-icon icon-close" %>
+ <%= link_to t(:button_cancel), admin_settings_storages_path, class: 'button -with-icon icon-close' %>
<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb b/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb
index 63ce79ca309..72a7fd4a94c 100644
--- a/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb
@@ -10,7 +10,7 @@
<fieldset class="form--fieldset">
<div class="form--field -required">
<%= f.text_field :client_id,
- label: t('storages.label_oauth_client_id'),
+ label: Storages::Admin::LABEL_OAUTH_CLIENT_ID,
required: true,
size: 40,
container_class: '-wide' %>
@@ -23,7 +23,7 @@
</div>
<div class="form--field -required">
<%= f.text_field :client_secret,
- label: t('storages.label_oauth_client_secret'),
+ label: Storages::Admin::LABEL_OAUTH_CLIENT_SECRET,
required: true,
size: 40,
container_class: '-wide' %>
diff --git a/modules/storages/app/views/storages/admin/storages/show.html.erb b/modules/storages/app/views/storages/admin/storages/show.html.erb
index 3737f1fdcbd..f26ac7a6659 100644
--- a/modules/storages/app/views/storages/admin/storages/show.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/show.html.erb
@@ -111,13 +111,13 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
<div class="attributes-key-value">
- <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_id') %></div>
+ <div class="attributes-key-value--key">OpenProject <%= Storages::Admin::LABEL_OAUTH_CLIENT_ID %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span><%= @object.oauth_application.uid %></span>
</div>
</div>
- <div class="attributes-key-value--key">OpenProject <%= t(:'storages.label_oauth_client_secret') %></div>
+ <div class="attributes-key-value--key">OpenProject <%= Storages::Admin::LABEL_OAUTH_CLIENT_SECRET %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span>●●●●●●●●●●●●●●●●</span>
@@ -135,13 +135,13 @@ See COPYRIGHT and LICENSE files for more details.
</div>
<% if @object.oauth_client %>
<div class="attributes-key-value">
- <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= t(:'storages.label_oauth_client_id') %></div>
+ <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= Storages::Admin::LABEL_OAUTH_CLIENT_ID %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span><%= @object.oauth_client.client_id %></span>
</div>
</div>
- <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= t(:'storages.label_oauth_client_secret') %></div>
+ <div class="attributes-key-value--key"><%= t("storages.provider_types.#{@object.provider_type}.name") %> <%= Storages::Admin::LABEL_OAUTH_CLIENT_SECRET %></div>
<div class="attributes-key-value--value-container">
<div class="attributes-key-value--value -text">
<span><%= short_secret(@object.oauth_client.client_secret) %></span>
diff --git a/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb b/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb
index 732033ebfa1..89a25357ab7 100644
--- a/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb
@@ -25,7 +25,7 @@
<%= labelled_tabular_form_for @oauth_application, url: '/' do |f| -%>
<fieldset class="form--fieldset">
<div class="form--field">
- <label class="form--label"><%= t('storages.label_oauth_client_id') %></label>
+ <label class="form--label"><%= Storages::Admin::LABEL_OAUTH_CLIENT_ID %></label>
<div class="form--field-container">
<div class="form--text-field-container -wide">
@@ -54,7 +54,7 @@
</div>
<div class="form--field">
- <label class="form--label"><%= t('storages.label_oauth_client_secret') %></label>
+ <label class="form--label"><%= Storages::Admin::LABEL_OAUTH_CLIENT_SECRET %></label>
<div class="form--field-container">
<div class="form--text-field-container -wide">
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 9635dda72f3..10423d03bf8 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -49,7 +49,6 @@ en:
replace_provider_type_oauth: "Replace %{provider_type} OAuth"
save_and_continue_setup: "Save and continue setup"
save_and_complete_setup: "Save and complete setup"
- cancel: "Cancel"
page_titles:
project_settings:
index: "File storages available in this project"
@@ -90,8 +89,6 @@ en:
label_storage: "Storage"
label_storages: "Storages"
no_results: "No storages set up, yet."
- label_oauth_client_id: "OAuth Client ID"
- label_oauth_client_secret: "OAuth Client Secret"
provider_types:
label: "Provider type"
nextcloud: