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

Use link_translate helper in more places

Jan Sandbrink3bc4c0865a8f
diff --git a/app/forms/scim_clients/form.rb b/app/forms/scim_clients/form.rb
index 23db6d44de3..f6838c15378 100644
--- a/app/forms/scim_clients/form.rb
+++ b/app/forms/scim_clients/form.rb
@@ -30,6 +30,8 @@
module ScimClients
class Form < ApplicationForm
+ include Redmine::I18n
+
form do |client_form|
client_form.text_field(
name: :name,
@@ -79,8 +81,9 @@ module ScimClients
name: :jwt_sub,
label: ScimClient.human_attribute_name(:jwt_sub),
required: true,
- caption: I18n.t("admin.scim_clients.form.jwt_sub_description_html",
- docs_url: ::OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_jwt_authetication_method)).html_safe,
+ caption: link_translate("admin.scim_clients.form.jwt_sub_description", links: {
+ docs_url: ::OpenProject::Static::Links.url_for(:sysadmin_docs, :scim_jwt_authetication_method)
+ }),
input_width: :large
)
end
diff --git a/app/forms/work_package_types/subject_configuration_form.rb b/app/forms/work_package_types/subject_configuration_form.rb
index f4cd7bd16f2..724652dc39a 100644
--- a/app/forms/work_package_types/subject_configuration_form.rb
+++ b/app/forms/work_package_types/subject_configuration_form.rb
@@ -30,6 +30,8 @@
module WorkPackageTypes
class SubjectConfigurationForm < ApplicationForm
+ include Redmine::I18n
+
form do |subject_form|
subject_form.radio_button_group(name: :subject_configuration) do |group|
group.radio_button(
@@ -84,17 +86,9 @@ module WorkPackageTypes
end
def pattern_input_caption
- I18n.t(
- "types.edit.subject_configuration.pattern.caption_with_supported_attributes_link",
- link: make_link(
- ::OpenProject::Static::Links.url_for(:enterprise_features, :work_package_subject_generation),
- I18n.t("types.edit.subject_configuration.pattern.supported_attributes_link")
- )
- ).html_safe
- end
-
- def make_link(href, link_text)
- render(Primer::Beta::Link.new(href:, target: "_blank", underline: true)) { link_text }
+ link_translate("types.edit.subject_configuration.pattern.caption", links: {
+ attributes_url: ::OpenProject::Static::Links.url_for(:enterprise_features, :work_package_subject_generation)
+ })
end
end
end
diff --git a/app/views/admin/scim_clients/edit.html.erb b/app/views/admin/scim_clients/edit.html.erb
index 9f8d922c8fa..d5d3153c94e 100644
--- a/app/views/admin/scim_clients/edit.html.erb
+++ b/app/views/admin/scim_clients/edit.html.erb
@@ -32,8 +32,11 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { @scim_client.name }
- header.with_description { t("admin.scim_clients.form.description_html",
- docs_url: ::OpenProject::Static::Links.url_for(:sysadmin_docs, :scim)) }
+ header.with_description do
+ link_translate("admin.scim_clients.form.description", links: {
+ docs_url: ::OpenProject::Static::Links.url_for(:sysadmin_docs, :scim)
+ })
+ end
header.with_breadcrumbs(
[{ href: admin_index_path, text: t(:label_administration) },
{ href: admin_settings_authentication_path, text: t(:label_authentication) },
diff --git a/app/views/admin/scim_clients/new.html.erb b/app/views/admin/scim_clients/new.html.erb
index 542906f271b..1f1e212eac4 100644
--- a/app/views/admin/scim_clients/new.html.erb
+++ b/app/views/admin/scim_clients/new.html.erb
@@ -32,7 +32,11 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { t(".title") }
- header.with_description { t("admin.scim_clients.form.description_html", docs_url: ::OpenProject::Static::Links.url_for(:sysadmin_docs, :scim)) }
+ header.with_description do
+ link_translate("admin.scim_clients.form.description", links: {
+ docs_url: ::OpenProject::Static::Links.url_for(:sysadmin_docs, :scim)
+ })
+ end
header.with_breadcrumbs(
[{ href: admin_index_path, text: t(:label_administration) },
{ href: admin_settings_authentication_path, text: t(:label_authentication) },
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d733fa16300..d3ff88a860b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -137,8 +137,8 @@ en:
form:
auth_provider_description: "This is the service that users added by the SCIM provider will use to authenticate in OpenProject."
authentication_method_description_html: "This is how the SCIM-client authenticates at OpenProject. Please ensure that OAuth tokens include the <code>scim_v2</code> scope."
- description_html: 'Please refer to our <a href="%{docs_url}">documentation on configuring SCIM-clients</a> for more information on these configuration options.'
- jwt_sub_description_html: 'For example, for Keycloak, this is the UUID of the service account associated with the SCIM-client. Consult <a href="%{docs_url}">our documentation</a> to learn how to find the subject claim for your use case.'
+ description: "Please refer to our [documentation on configuring SCIM-clients](docs_url) for more information on these configuration options."
+ jwt_sub_description: "For example, for Keycloak, this is the UUID of the service account associated with the SCIM-client. Consult [our documentation](docs_url) to learn how to find the subject claim for your use case."
name_description: "Choose a name that will help other admins better understand why this client was configured."
index:
description: "SCIM-clients configured here are able to interact with OpenProject SCIM server API to provision, update, and deprovision user accounts and groups."
@@ -774,9 +774,8 @@ en:
project: "Project"
pattern:
label: "Subject pattern"
- caption_with_supported_attributes_link: Create patterns by adding text, or type "/" to search for %{link}.
+ caption: Create patterns by adding text, or type "/" to search for [supported attributes](attributes_url).
insert_as_text: "No attributes found. Add as text: \"%{word}\""
- supported_attributes_link: "supported attributes"
export_configuration:
tab: "Generate PDF"
intro: "Select which templates from those that are available you would like to enable for this type. The template determines the design and attributes visible in the exported PDF of a work package using this type. The first template on the list is selected by default."