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

move text into I18n

as-opa0aebb1683f5
diff --git a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
index 8b248ced4b5..9a105d4c624 100644
--- a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
+++ b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
@@ -15,7 +15,7 @@ class CostQuery::PDF::TimesheetGenerator
end
def heading
- query.name || "Timesheet"
+ query.name || I18n.t(:"export.timesheet.timesheet")
end
def footer_title
@@ -103,7 +103,13 @@ class CostQuery::PDF::TimesheetGenerator
# rubocop:enable Metrics/AbcSize
def table_header_columns
- with_times_column? ? ["Date", "Work package", "Time", "Hours", "Activity"] : ["Date", "Work package", "Hours", "Activity"]
+ [
+ I18n.t(:"activerecord.attributes.time_entry.spent_on"),
+ I18n.t(:"activerecord.models.work_package"),
+ with_times_column? ? I18n.t(:"export.timesheet.time") : nil,
+ I18n.t(:"activerecord.attributes.time_entry.hours"),
+ I18n.t(:"activerecord.attributes.time_entry.activity")
+ ].compact
end
def table_columns_widths
diff --git a/modules/reporting/config/locales/en.yml b/modules/reporting/config/locales/en.yml
index bf5feeb9ea5..1b56799a2c0 100644
--- a/modules/reporting/config/locales/en.yml
+++ b/modules/reporting/config/locales/en.yml
@@ -108,6 +108,8 @@ en:
timesheet:
title: "Your PDF timesheet export"
button: "Export PDF timesheet"
+ timesheet: "Timesheet"
+ time: "Time"
cost_reports:
title: "Your Cost Reports XLS export"