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

Internationalize plugins name and description

Christophe Bliard3871a475466d
diff --git a/app/views/admin/plugins.html.erb b/app/views/admin/plugins.html.erb
index 5dd76ea26ae..87b8b5b4316 100644
--- a/app/views/admin/plugins.html.erb
+++ b/app/views/admin/plugins.html.erb
@@ -70,22 +70,21 @@ See COPYRIGHT and LICENSE files for more details.
<% @plugins.each do |plugin| %>
<tr>
<td><span class="name"><%=h plugin.name %></span>
- <%= content_tag('span', h(plugin.description), class: 'description') unless plugin.description.blank? %>
- <%= content_tag('span', link_to(h(plugin.url), plugin.url), class: 'url') unless plugin.url.blank? %>
+ <%= content_tag('span', plugin.description, class: 'description') if plugin.description.present? %>
+ <%= content_tag('span', link_to(plugin.url, plugin.url), class: 'url') if plugin.url.present? %>
</td>
- <td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
+ <td class="author"><%= plugin.author_url.blank? ? plugin.author : link_to(plugin.author, plugin.author_url) %></td>
<td class="version">
<% if plugin.bundled %>
<%= t(:label_bundled) %>
<% else %>
- <%= h plugin.version %>
+ <%= plugin.version %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
-
</div>
</div>
<% else %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d5e5657e737..cda42df09b3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -3373,3 +3373,10 @@ en:
unexpected: "Unexpected response received."
you: you
+
+ plugin_openproject_auth_plugins:
+ name: "OpenProject Auth Plugins"
+ description: "Integration of OmniAuth strategy providers for authentication in Openproject."
+ plugin_openproject_auth_saml:
+ name: "OmniAuth SAML / Single-Sign On"
+ description: "Adds the OmniAuth SAML provider to OpenProject"
diff --git a/lib/open_project/plugins/acts_as_op_engine.rb b/lib/open_project/plugins/acts_as_op_engine.rb
index 7fbe28328e7..35321b535ee 100644
--- a/lib/open_project/plugins/acts_as_op_engine.rb
+++ b/lib/open_project/plugins/acts_as_op_engine.rb
@@ -177,12 +177,11 @@ module OpenProject::Plugins
# block: Pass a block to the plugin (for defining permissions, menu items and the like)
def register(gem_name, options, &block)
self.class.initializer "#{engine_name}.register_plugin" do
- spec = Bundler.load.specs[gem_name][0]
+ spec = Gem.loaded_specs[gem_name]
p = Redmine::Plugin.register engine_name.to_sym do
- name spec.summary
+ gem_name spec.name
author spec.authors.is_a?(Array) ? spec.authors[0] : spec.authors
- description spec.description
version spec.version
url spec.homepage
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb
index c4ba56a6d92..ed0e4b9982c 100644
--- a/lib/redmine/plugin.rb
+++ b/lib/redmine/plugin.rb
@@ -95,7 +95,7 @@ module Redmine # :nodoc:
end
end
end
- def_field :description, :url, :author, :author_url, :version, :settings, :bundled
+ def_field :gem_name, :url, :author, :author_url, :version, :settings, :bundled
attr_reader :id
# Plugin constructor
@@ -133,15 +133,21 @@ module Redmine # :nodoc:
def name(*args)
name = args.empty? ? instance_variable_get("@name") : instance_variable_set("@name", *args)
- case name
- when Symbol
- ::I18n.t(name)
- when NilClass
- # Default name if it was not provided during registration
- id.to_s.humanize
- else
- name
- end
+ return ::I18n.t(name) if name.is_a?(Symbol)
+ return name if name
+
+ translated_name = ::I18n.t("plugin_#{id}.name", default: nil)
+ translated_name || gemspec&.summary || id.to_s.humanize
+ end
+
+ def description(*args)
+ description = args.empty? ? instance_variable_get("@description") : instance_variable_set("@description", *args)
+
+ description || ::I18n.t("plugin_#{id}.description", default: gemspec&.description)
+ end
+
+ def gemspec
+ Gem.loaded_specs[gem_name]
end
# returns an array of all dependencies we know of for plugin id
@@ -201,8 +207,8 @@ module Redmine # :nodoc:
# # Requires OpenProject between 1.1.0 and 1.1.5 or higher
# requires_openproject ">= 1.1.0", "<= 1.1.5"
- def requires_openproject(*args)
- required_version = Gem::Requirement.new(*args)
+ def requires_openproject(*)
+ required_version = Gem::Requirement.new(*)
op_version = Gem::Version.new(OpenProject::VERSION.to_semver)
unless required_version.satisfied_by? op_version
@@ -362,9 +368,9 @@ module Redmine # :nodoc:
# Meeting.find_events('scrums', User.current, 5.days.ago, Date.today, project: foo) # events for project foo only
#
# Note that :view_scrums permission is required to view these events in the activity view.
- def activity_provider(*args)
+ def activity_provider(*)
ActiveSupport::Deprecation.warn('Use ActsAsOpEngine#activity_provider instead.')
- OpenProject::Activity.register(*args)
+ OpenProject::Activity.register(*)
end
# Registers a wiki formatter.
diff --git a/modules/avatars/config/locales/en.yml b/modules/avatars/config/locales/en.yml
index abbfc326ea2..780d08d4ccf 100644
--- a/modules/avatars/config/locales/en.yml
+++ b/modules/avatars/config/locales/en.yml
@@ -1,5 +1,11 @@
# English strings go here
en:
+ plugin_openproject_avatars:
+ name: "Avatars"
+ description: >-
+ This plugin allows OpenProject users to upload a picture to be used as an avatar or use
+ registered images from Gravatar.
+
label_avatar: "Avatar"
label_avatar_plural: "Avatars"
label_current_avatar: "Current Avatar"
@@ -36,6 +42,3 @@ en:
enable_gravatars: 'Enable user gravatars'
gravatar_default: "Default Gravatar image"
enable_local_avatars: 'Enable user custom avatars'
-
-
-
diff --git a/modules/avatars/lib/open_project/avatars/engine.rb b/modules/avatars/lib/open_project/avatars/engine.rb
index eda7f6a92d0..e9e502e74ae 100644
--- a/modules/avatars/lib/open_project/avatars/engine.rb
+++ b/modules/avatars/lib/open_project/avatars/engine.rb
@@ -32,7 +32,6 @@ module OpenProject::Avatars
partial: 'settings/openproject_avatars',
menu_item: :user_avatars
},
- name: :label_avatar_plural,
bundled: true do
add_menu_item :my_menu, :avatar,
{ controller: '/avatars/my_avatar', action: 'show' },
diff --git a/modules/backlogs/config/locales/en.yml b/modules/backlogs/config/locales/en.yml
index 418f195dfe1..bc1346869e4 100644
--- a/modules/backlogs/config/locales/en.yml
+++ b/modules/backlogs/config/locales/en.yml
@@ -28,6 +28,10 @@
---
en:
+ plugin_openproject_backlogs:
+ name: "OpenProject Backlogs"
+ description: "This module adds features enabling agile teams to work with OpenProject in Scrum projects."
+
activerecord:
attributes:
work_package:
diff --git a/modules/bim/config/locales/en.yml b/modules/bim/config/locales/en.yml
index 122c880b1a0..a500501d80c 100644
--- a/modules/bim/config/locales/en.yml
+++ b/modules/bim/config/locales/en.yml
@@ -1,5 +1,9 @@
# English strings go here for Rails i18n
en:
+ plugin_openproject_bim:
+ name: "OpenProject BIM and BCF functionality"
+ description: "This OpenProject plugin introduces BIM and BCF functionality."
+
bim:
label_bim: 'BIM'
diff --git a/modules/boards/config/locales/en.yml b/modules/boards/config/locales/en.yml
index e303e52bf32..02514fafb78 100644
--- a/modules/boards/config/locales/en.yml
+++ b/modules/boards/config/locales/en.yml
@@ -1,5 +1,9 @@
# English strings go here
en:
+ plugin_openproject_boards:
+ name: "OpenProject Boards"
+ description: "Provides board views."
+
permission_show_board_views: "View boards"
permission_manage_board_views: "Manage boards"
project_module_board_view: "Boards"
@@ -35,7 +39,7 @@ en:
Board with automated columns for subprojects.
Dragging work packages to other lists updates the (sub-)project accordingly.
subtasks: >
- Board with automated columns for sub-elements.
+ Board with automated columns for sub-elements.
Dragging work packages to other lists updates the parent accordingly.
upsale:
diff --git a/modules/boards/lib/open_project/boards/engine.rb b/modules/boards/lib/open_project/boards/engine.rb
index 5ac9e6ec1e4..63c9b28fe05 100644
--- a/modules/boards/lib/open_project/boards/engine.rb
+++ b/modules/boards/lib/open_project/boards/engine.rb
@@ -25,8 +25,7 @@ module OpenProject::Boards
register 'openproject-boards',
author_url: 'https://www.openproject.org',
bundled: true,
- settings: {},
- name: 'OpenProject Boards' do
+ settings: {} do
project_module :board_view, dependencies: :work_package_tracking, order: 80 do
permission :show_board_views,
{ 'boards/boards': %i[index show] },
@@ -54,8 +53,8 @@ module OpenProject::Boards
caption: :'boards.label_boards'
should_render_global_menu_item = Proc.new do
- (User.current.logged? || !Setting.login_required?) &&
- User.current.allowed_to_globally?(:show_board_views)
+ (User.current.logged? || !Setting.login_required?) &&
+ User.current.allowed_to_globally?(:show_board_views)
end
menu :top_menu,
diff --git a/modules/budgets/config/locales/en.yml b/modules/budgets/config/locales/en.yml
index faef025c275..6442fe7be3d 100644
--- a/modules/budgets/config/locales/en.yml
+++ b/modules/budgets/config/locales/en.yml
@@ -28,6 +28,9 @@
---
en:
+ plugin_budgets_engine:
+ name: 'Budgets'
+
activerecord:
attributes:
budget:
diff --git a/modules/budgets/lib/budgets/engine.rb b/modules/budgets/lib/budgets/engine.rb
index 456384c69d3..3a7aff0a67e 100644
--- a/modules/budgets/lib/budgets/engine.rb
+++ b/modules/budgets/lib/budgets/engine.rb
@@ -4,8 +4,7 @@ module Budgets
register 'budgets',
author_url: 'https://www.openproject.org',
- bundled: true,
- name: 'Budgets' do
+ bundled: true do
project_module :budgets do
permission :view_budgets, { budgets: %i[index show] }
permission :edit_budgets, { budgets: %i[index show edit update destroy destroy_info new create copy] }
diff --git a/modules/calendar/config/locales/en.yml b/modules/calendar/config/locales/en.yml
index 2e9040e5e8e..a4161312c15 100644
--- a/modules/calendar/config/locales/en.yml
+++ b/modules/calendar/config/locales/en.yml
@@ -1,5 +1,9 @@
# English strings go here
en:
+ plugin_openproject_calendar:
+ name: "OpenProject Calendar"
+ description: "Provides calendar views."
+
label_calendar: "Calendar"
label_calendar_plural: "Calendars"
label_new_calendar: "New calendar"
diff --git a/modules/calendar/lib/open_project/calendar/engine.rb b/modules/calendar/lib/open_project/calendar/engine.rb
index 27f6bbea522..8c281f738ab 100644
--- a/modules/calendar/lib/open_project/calendar/engine.rb
+++ b/modules/calendar/lib/open_project/calendar/engine.rb
@@ -25,8 +25,7 @@ module OpenProject::Calendar
register 'openproject-calendar',
author_url: 'https://www.openproject.org',
bundled: true,
- settings: {},
- name: 'OpenProject Calendar' do
+ settings: {} do
project_module :calendar_view, dependencies: :work_package_tracking do
permission :view_calendar,
{ 'calendar/calendars': %i[index show] },
diff --git a/modules/costs/config/locales/en.yml b/modules/costs/config/locales/en.yml
index c3725999086..80cc5cb1c5f 100644
--- a/modules/costs/config/locales/en.yml
+++ b/modules/costs/config/locales/en.yml
@@ -28,6 +28,10 @@
---
en:
+ plugin_costs:
+ name: "Time and costs"
+ description: "This module adds features for planning and tracking costs of projects."
+
activerecord:
attributes:
cost_entry:
diff --git a/modules/costs/lib/costs/engine.rb b/modules/costs/lib/costs/engine.rb
index d151e41a2b2..956586414dc 100644
--- a/modules/costs/lib/costs/engine.rb
+++ b/modules/costs/lib/costs/engine.rb
@@ -41,8 +41,7 @@ module Costs
default: { 'costs_currency' => 'EUR', 'costs_currency_format' => '%n %u' },
partial: 'settings/costs',
menu_item: :costs_setting
- },
- name: :project_module_costs do
+ } do
project_module :costs do
permission :view_time_entries, {}
permission :view_own_time_entries, {}
diff --git a/modules/documents/config/locales/en.yml b/modules/documents/config/locales/en.yml
index 73649ce5300..82a17bf422c 100644
--- a/modules/documents/config/locales/en.yml
+++ b/modules/documents/config/locales/en.yml
@@ -27,6 +27,10 @@
#++
en:
+ plugin_openproject_documents:
+ name: "OpenProject Documents"
+ description: "An OpenProject plugin to allow creation of documents in projects."
+
activerecord:
models:
document: "Document"
diff --git a/modules/github_integration/config/locales/en.yml b/modules/github_integration/config/locales/en.yml
index e540b39366c..46cffdde4e1 100644
--- a/modules/github_integration/config/locales/en.yml
+++ b/modules/github_integration/config/locales/en.yml
@@ -27,6 +27,9 @@
#++
en:
+ plugin_openproject_github_integration:
+ name: "OpenProject GitHub Integration"
+ description: "Integrates OpenProject and GitHub for a better workflow"
+
project_module_github: "GitHub"
permission_show_github_content: "Show GitHub content"
-
diff --git a/modules/job_status/config/locales/en.yml b/modules/job_status/config/locales/en.yml
new file mode 100644
index 00000000000..804da1c8f00
--- /dev/null
+++ b/modules/job_status/config/locales/en.yml
@@ -0,0 +1,4 @@
+en:
+ plugin_openproject_job_status:
+ name: "OpenProject Job status"
+ description: "Listing and status of background jobs."
diff --git a/modules/ldap_groups/config/locales/en.yml b/modules/ldap_groups/config/locales/en.yml
index 9399786d4f4..11a79a61ee9 100644
--- a/modules/ldap_groups/config/locales/en.yml
+++ b/modules/ldap_groups/config/locales/en.yml
@@ -1,4 +1,7 @@
en:
+ plugin_openproject_ldap_groups:
+ name: "OpenProject LDAP groups"
+ description: "Synchronization of LDAP group memberships."
activerecord:
attributes:
ldap_groups/synchronized_group:
@@ -74,4 +77,3 @@ en:
group_text: 'Select an existing OpenProject group that members of the LDAP group shall be synchronized with'
upsale:
description: 'Take advantage of synchronised LDAP groups to manage users, change their permissions and facilitate user management across groups.'
-
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index 5704ddae3c6..d0ba3c5434d 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -28,6 +28,14 @@
# English strings go here for Rails i18n
en:
+ plugin_openproject_meeting:
+ name: "OpenProject Meeting"
+ description: >-
+ This module adds functions to support project meetings to OpenProject. Meetings can be
+ scheduled selecting invitees from the same project to take part in the meeting. An agenda can
+ be created and sent to the invitees. After the meeting, attendees can be selected and minutes
+ can be created based on the agenda. Finally, the minutes can be sent to all attendees and
+ invitees.
activerecord:
attributes:
meeting:
diff --git a/modules/openid_connect/config/locales/en.yml b/modules/openid_connect/config/locales/en.yml
index 00609db06eb..faada1e506c 100644
--- a/modules/openid_connect/config/locales/en.yml
+++ b/modules/openid_connect/config/locales/en.yml
@@ -1,4 +1,7 @@
en:
+ plugin_openproject_openid_connect:
+ name: "OpenProject OpenID Connect"
+ description: "Adds OmniAuth OpenID Connect strategy providers to Openproject."
logout_warning: >
You have been logged out. The contents of any form you submit may be lost.
Please [log in].
diff --git a/modules/recaptcha/config/locales/en.yml b/modules/recaptcha/config/locales/en.yml
index 0eada05185a..7e61925a66e 100644
--- a/modules/recaptcha/config/locales/en.yml
+++ b/modules/recaptcha/config/locales/en.yml
@@ -1,5 +1,8 @@
# English strings go here for Rails i18n
en:
+ plugin_openproject_recaptcha:
+ name: "OpenProject ReCaptcha"
+ description: "This module provides recaptcha checks during login."
recaptcha:
label_recaptcha: "reCAPTCHA"
button_please_wait: 'Please wait ...'
diff --git a/modules/reporting/config/locales/en.yml b/modules/reporting/config/locales/en.yml
index a59d5d0826d..6002e8d31bc 100644
--- a/modules/reporting/config/locales/en.yml
+++ b/modules/reporting/config/locales/en.yml
@@ -28,6 +28,10 @@
---
en:
+ plugin_openproject_reporting:
+ name: "OpenProject Reporting"
+ description: "This plugin allows creating custom cost reports with filtering and grouping created by the OpenProject Time and costs plugin."
+
button_save_as: "Save report as..."
comments: "Comment"
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 8dbaa19b07d..db36fb43a15 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -1,5 +1,9 @@
# English strings go here
en:
+ plugin_openproject_storages:
+ name: "OpenProject Storages"
+ description: "Allows linking work packages to files in external storages, such as Nextcloud."
+
permission_view_file_links: "View file links"
permission_manage_file_links: "Manage file links"
permission_manage_storages_in_project: "Manage file storages in project"
diff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rb
index cf28fdd5f1b..4e0e81ab5fd 100644
--- a/modules/storages/lib/open_project/storages/engine.rb
+++ b/modules/storages/lib/open_project/storages/engine.rb
@@ -105,8 +105,7 @@ module OpenProject::Storages
register 'openproject-storages',
author_url: 'https://www.openproject.org',
bundled: true,
- settings: {},
- name: 'OpenProject Storages' do
+ settings: {} do
# Defines permission constraints used in the module (controller, etc.)
# Permissions documentation: https://www.openproject.org/docs/development/concepts/permissions/#definition-of-permissions
project_module :storages,
diff --git a/modules/team_planner/config/locales/en.yml b/modules/team_planner/config/locales/en.yml
index eb7195318df..4056518b898 100644
--- a/modules/team_planner/config/locales/en.yml
+++ b/modules/team_planner/config/locales/en.yml
@@ -1,5 +1,9 @@
# English strings go here
en:
+ plugin_openproject_team_planner:
+ name: "OpenProject Team Planner"
+ description: "Provides team planner views."
+
permission_view_team_planner: "View team planner"
permission_manage_team_planner: "Manage team planner"
project_module_team_planner_view: "Team planners"
diff --git a/modules/team_planner/lib/open_project/team_planner/engine.rb b/modules/team_planner/lib/open_project/team_planner/engine.rb
index 4091650be18..60915b63091 100644
--- a/modules/team_planner/lib/open_project/team_planner/engine.rb
+++ b/modules/team_planner/lib/open_project/team_planner/engine.rb
@@ -25,8 +25,7 @@ module OpenProject::TeamPlanner
register 'openproject-team_planner',
author_url: 'https://www.openproject.org',
bundled: true,
- settings: {},
- name: 'OpenProject Team Planner' do
+ settings: {} do
project_module :team_planner_view, dependencies: :work_package_tracking, enterprise_feature: true do
permission :view_team_planner,
{ 'team_planner/team_planner': %i[index show upsale overview] },
@@ -39,8 +38,8 @@ module OpenProject::TeamPlanner
end
should_render_global_menu_item = Proc.new do
- (User.current.logged? || !Setting.login_required?) &&
- User.current.allowed_to_globally?(:view_team_planner)
+ (User.current.logged? || !Setting.login_required?) &&
+ User.current.allowed_to_globally?(:view_team_planner)
end
menu :global_menu,
diff --git a/modules/two_factor_authentication/config/locales/en.yml b/modules/two_factor_authentication/config/locales/en.yml
index f9d60abfb75..5a5b38a9080 100644
--- a/modules/two_factor_authentication/config/locales/en.yml
+++ b/modules/two_factor_authentication/config/locales/en.yml
@@ -1,5 +1,12 @@
# English strings go here for Rails i18n
en:
+ plugin_openproject_two_factor_authentication:
+ name: "OpenProject Two-factor authentication"
+ description: >-
+ This OpenProject plugin authenticates your users using two-factor authentication by means of
+ one-time password through the TOTP standard (Google Authenticator) or sent to the user's cell
+ phone via SMS or voice call.
+
activerecord:
attributes:
two_factor_authentication/device:
diff --git a/modules/webhooks/config/locales/en.yml b/modules/webhooks/config/locales/en.yml
index 5a03e57886d..42aae29dc6e 100644
--- a/modules/webhooks/config/locales/en.yml
+++ b/modules/webhooks/config/locales/en.yml
@@ -1,4 +1,8 @@
en:
+ plugin_openproject_webhooks:
+ name: "OpenProject Webhooks"
+ description: "Provides a plug-in API to support OpenProject webhooks for better 3rd party integration."
+
activerecord:
attributes:
webhooks/webhook:
diff --git a/modules/xls_export/config/locales/en.yml b/modules/xls_export/config/locales/en.yml
index ff907b35a7b..95411406927 100644
--- a/modules/xls_export/config/locales/en.yml
+++ b/modules/xls_export/config/locales/en.yml
@@ -1,4 +1,8 @@
en:
+ plugin_openproject_xls_export:
+ name: "OpenProject XLS Export"
+ description: "Export issue lists as Excel spreadsheets (.xls)."
+
export_to_excel: "Export XLS"
print_with_description: "Print preview with description"
sentence_separator_or: "or"