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

update i18n references

ulferts5a377cc32190
diff --git a/modules/xls_export/config/locales/en.yml b/modules/xls_export/config/locales/en.yml
index 5508f93eedd..ce2580c893e 100644
--- a/modules/xls_export/config/locales/en.yml
+++ b/modules/xls_export/config/locales/en.yml
@@ -1,5 +1,5 @@
en:
- export_to_excel: "Export as Excel spreadsheet"
+ export_to_excel: "Export as excel spreadsheet"
print_with_description: "Print preview with description"
sentence_separator_or: "or"
different_formats: Different formats
diff --git a/modules/xls_export/lib/open_project/xls_export/xls_views/cost_entry_table.xls.rb b/modules/xls_export/lib/open_project/xls_export/xls_views/cost_entry_table.xls.rb
index 169e5bcf030..0c21ae0ac38 100644
--- a/modules/xls_export/lib/open_project/xls_export/xls_views/cost_entry_table.xls.rb
+++ b/modules/xls_export/lib/open_project/xls_export/xls_views/cost_entry_table.xls.rb
@@ -25,9 +25,9 @@ class OpenProject::XlsExport::XlsViews::CostEntryTable < OpenProject::XlsExport:
list = %i[spent_on user_id activity_id issue_id comments project_id]
headers = list.collect { |field| label_for(field) }
- headers << I18n.t(:units)
- headers << I18n.t(:field_cost_type)
- headers << I18n.t(:field_costs)
+ headers << CostEntry.human_attribute_name(:units)
+ headers << CostType.model_name.human
+ headers << CostEntry.human_attribute_name(:costs)
spreadsheet.add_headers(headers)
spreadsheet.add_format_option_to_column(headers.length - 1, number_format: number_to_currency(0.00))
diff --git a/modules/xls_export/lib/open_project/xls_export/xls_views/cost_report_table.xls.rb b/modules/xls_export/lib/open_project/xls_export/xls_views/cost_report_table.xls.rb
index 73a7e7e4523..640d1567c81 100644
--- a/modules/xls_export/lib/open_project/xls_export/xls_views/cost_report_table.xls.rb
+++ b/modules/xls_export/lib/open_project/xls_export/xls_views/cost_report_table.xls.rb
@@ -125,10 +125,12 @@ class OpenProject::XlsExport::XlsViews::CostReportTable < OpenProject::XlsExport
end
def label
- "#{I18n.t(:caption_cost_type)}: " + case unit_id
- when -1 then I18n.t(:field_hours)
- when 0 then "EUR"
- else cost_type.unit_plural
- end
+ unit = case unit_id
+ when -1 then CostEntry.human_attribute_name(:hours)
+ when 0 then Setting.plugin_openproject_costs['costs_currency']
+ else cost_type.unit_plural
+ end
+
+ "#{CostType.model_name.human}: #{unit}"
end
end