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

Localize modal strings

Aaron Contreras52d8f3ae4f88
diff --git a/app/components/work_packages/progress/status_based/modal_body_component.html.erb b/app/components/work_packages/progress/status_based/modal_body_component.html.erb
index 329d75c0fff..ef6177f8186 100644
--- a/app/components/work_packages/progress/status_based/modal_body_component.html.erb
+++ b/app/components/work_packages/progress/status_based/modal_body_component.html.erb
@@ -12,15 +12,15 @@
<% end %>
<% modal_body.with_row(mt: 3) do |_tooltip| %>
- <%= render(Primer::Beta::Text.new(font_weight: :semibold)) { "Note:" } %>
- <%= render(Primer::Beta::Text.new) { "% Complete is set by work package status." } %>
- <%= render(Primer::Beta::Link.new(href: "#")) { "Learn more" } %>
+ <%= render(Primer::Beta::Text.new(font_weight: :semibold)) { t("work_package.progress.label_note") } %>
+ <%= render(Primer::Beta::Text.new) { t("work_package.progress.modal.status_based_help_text") } %>
+ <%= render(Primer::Beta::Link.new(href: "#")) { t(:label_learn_more) } %>
<% end %>
<% modal_body.with_row(mt: 3) do |_actions_row| %>
<%= flex_layout(mt: 3, justify_content: :flex_end) do |action_buttons| %>
<%= action_buttons.with_column do %>
- <%= f.submit "Save", class: "btn btn-primary" %>
+ <%= f.submit t(:button_save), class: "btn btn-primary" %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/progress/work_based/modal_body_component.html.erb b/app/components/work_packages/progress/work_based/modal_body_component.html.erb
index f9bef9cf68a..15be9bcf372 100644
--- a/app/components/work_packages/progress/work_based/modal_body_component.html.erb
+++ b/app/components/work_packages/progress/work_based/modal_body_component.html.erb
@@ -12,15 +12,15 @@
<% end %>
<% modal_body.with_row(mt: 3) do |_tooltip| %>
- <%= render(Primer::Beta::Text.new(font_weight: :semibold)) { "Note:" } %>
- <%= render(Primer::Beta::Text.new) { "% Complete is automatically derived from Work and Remaining work." } %>
- <%= render(Primer::Beta::Link.new(href: "#")) { "Learn more" } %>
+ <%= render(Primer::Beta::Text.new(font_weight: :semibold)) { t("work_package.progress.label_note") } %>
+ <%= render(Primer::Beta::Text.new) { t("work_package.progress.modal.work_based_help_text") } %>
+ <%= render(Primer::Beta::Link.new(href: "#")) { t(:label_learn_more) } %>
<% end %>
<% modal_body.with_row(mt: 3) do |_actions_row| %>
<%= flex_layout(mt: 3, justify_content: :flex_end) do |action_buttons| %>
<%= action_buttons.with_column do %>
- <%= f.submit "Save", class: "btn btn-primary" %>
+ <%= f.submit t(:button_save), class: "btn btn-primary" %>
<% end %>
<% end %>
<% end %>
diff --git a/app/forms/work_packages/progress_form.rb b/app/forms/work_packages/progress_form.rb
index e684d9d4533..c0d46859599 100644
--- a/app/forms/work_packages/progress_form.rb
+++ b/app/forms/work_packages/progress_form.rb
@@ -40,7 +40,7 @@ class WorkPackages::ProgressForm < ApplicationForm
form do |query_form|
query_form.group(layout: :horizontal) do |group|
if @mode == :status_based
- select_field_options = { name: :status_id, label: "% Complete" }.tap do |options|
+ select_field_options = { name: :status_id, label: I18n.t(:label_percent_complete) }.tap do |options|
options.reverse_merge!(default_field_options(:status_id))
options.merge!(disabled: @work_package.new_record?)
end
@@ -56,12 +56,13 @@ class WorkPackages::ProgressForm < ApplicationForm
end
end
- render_text_field(group, name: :estimated_hours, label: "Work")
- render_readonly_text_field(group, name: :remaining_hours, label: "Remaining work")
+ render_text_field(group, name: :estimated_hours, label: I18n.t(:label_work))
+ render_readonly_text_field(group, name: :remaining_hours, label: I18n.t(:label_remaining_work))
else
- render_text_field(group, name: :estimated_hours, label: "Work")
- render_text_field(group, name: :remaining_hours, label: "Remaining work", disabled: @work_package.estimated_hours.nil?)
- render_readonly_text_field(group, name: :done_ratio, label: "% Complete")
+ render_text_field(group, name: :estimated_hours, label: I18n.t(:label_work))
+ render_text_field(group, name: :remaining_hours, label: I18n.t(:label_remaining_work),
+ disabled: @work_package.estimated_hours.nil?)
+ render_readonly_text_field(group, name: :done_ratio, label: I18n.t(:label_percent_complete))
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 3c930d65152..f480a474ed2 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1422,7 +1422,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
create_new_page: "Wiki page"
date:
- abbr_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+ abbr_day_names: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
abbr_month_names:
[
~,
@@ -2117,6 +2117,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
label_latest_revision: "Latest revision"
label_latest_revision_plural: "Latest revisions"
label_ldap_authentication: "LDAP authentication"
+ label_learn_more: "Learn more"
label_less_or_equal: "<="
label_less_than_ago: "less than days ago"
label_list: "List"
@@ -2242,6 +2243,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
label_privacy_policy: "Data privacy and security policy"
label_product_version: "Product version"
label_profile: "Profile"
+ label_percent_complete: "% Complete"
label_project_activity: "Project activity"
label_project_attribute_plural: "Project attributes"
label_project_count: "Total number of projects"
@@ -2277,6 +2279,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
label_relation_delete: "Delete relation"
label_relation_new: "New relation"
label_release_notes: "Release notes"
+ label_remaining_work: "Remaining work"
label_remove_columns: "Remove selected columns"
label_renamed: "renamed"
label_reply_plural: "Replies"
@@ -2410,6 +2413,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
label_wiki_show_new_page_link: "Show submenu item 'Create new child page'"
label_wiki_show_submenu_item: "Show as submenu item of "
label_wiki_start: "Start page"
+ label_work: "Work"
label_work_package: "Work package"
label_work_package_attachments: "Work package attachments"
label_work_package_category_new: "New category"
@@ -3545,6 +3549,11 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
destroy:
info: "Deleting the work package is an irreversible action."
title: "Delete the work package"
+ progress:
+ label_note: "Note:"
+ modal:
+ work_based_help_text: "% Complete is automatically derived from Work and Remaining work."
+ status_based_help_text: "% Complete is set by work package status."
sharing:
count:
zero: "0 users"