Fix report table translations [SCI-11594]

This commit is contained in:
Anton 2025-02-20 13:53:46 +01:00
parent 5a1da39011
commit 758eee7041

View file

@ -7,11 +7,19 @@ module Reports::Docx::DrawStepTable
settings = @settings
obj = self
obj.render_table(table, table_type, color)
i18n_string = if table_type == 'step_table'
'projects.reports.elements.step_table'
elsif table_type == 'well_plates_table'
'projects.reports.elements.step_well_plates_table'
end
@docx.p do
text I18n.t("projects.reports.elements.step_#{table_type}.table_name", name: table.name), italic: true
text I18n.t("#{i18n_string}.table_name", name: table.name), italic: true
unless settings['exclude_timestamps']
text ' '
text I18n.t("projects.reports.elements.step_#{table_type}.user_time",
text I18n.t("#{i18n_string}.user_time",
timestamp: I18n.l(timestamp, format: :full)), color: color[:gray]
end
end