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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add i18n for project activity details
Christophe Bliardadf003e99d6c
diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 29d20aa2949..383b117765c 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -537,14 +537,24 @@ en:member:roles: "Roles"project:+ active_value:+ true: "unarchived"+ false: "archived"identifier: "Identifier"latest_activity_at: "Latest activity at"parent: "Subproject of"+ public_value:+ title: "Visibility"+ true: "public"+ false: "private"queries: "Queries"+ templated: "Template project"+ templated_value:+ true: "marked as template"+ false: "unmarked as template"types: "Types"versions: "Versions"work_packages: "Work Packages"- templated: 'Template project'projects/status:code: 'Status'explanation: 'Status description'diff --git a/lib/open_project/journal_formatter/active_status.rb b/lib/open_project/journal_formatter/active_status.rbindex cb171805bd3..479020a8b28 100644--- a/lib/open_project/journal_formatter/active_status.rb+++ b/lib/open_project/journal_formatter/active_status.rb@@ -28,9 +28,16 @@class OpenProject::JournalFormatter::ActiveStatus < JournalFormatter::Basedef render(_key, values, options = { html: true })- label_text = options[:html] ? content_tag('strong', "Project") : "Project"- activated_text = values.last ? "unarchived" : "archived"+ label_text = label('project')+ label_text = content_tag('strong', label_text) if options[:html]- I18n.t(:text_journal_label_value, label: label_text, value: activated_text)+ value = \+ if values.last+ I18n.t('activerecord.attributes.project.active_value.true')+ else+ I18n.t('activerecord.attributes.project.active_value.false')+ end++ I18n.t(:text_journal_label_value, label: label_text, value:)endenddiff --git a/lib/open_project/journal_formatter/template.rb b/lib/open_project/journal_formatter/template.rbindex 7484a95b836..f5cc51fa95d 100644--- a/lib/open_project/journal_formatter/template.rb+++ b/lib/open_project/journal_formatter/template.rb@@ -28,9 +28,16 @@class OpenProject::JournalFormatter::Template < JournalFormatter::Basedef render(_key, values, options = { html: true })- label_text = options[:html] ? content_tag('strong', "Project") : "Project"- activated_text = values.last ? "marked as template" : "unmarked as template"+ label_text = label('project')+ label_text = content_tag('strong', label_text) if options[:html]- I18n.t(:text_journal_label_value, label: label_text, value: activated_text)+ value = \+ if values.last+ I18n.t('activerecord.attributes.project.templated_value.true')+ else+ I18n.t('activerecord.attributes.project.templated_value.false')+ end++ I18n.t(:text_journal_label_value, label: label_text, value:)endenddiff --git a/lib/open_project/journal_formatter/visibility.rb b/lib/open_project/journal_formatter/visibility.rbindex bc6289c5e19..44f7a403f96 100644--- a/lib/open_project/journal_formatter/visibility.rb+++ b/lib/open_project/journal_formatter/visibility.rb@@ -28,9 +28,16 @@class OpenProject::JournalFormatter::Visibility < JournalFormatter::Basedef render(_key, values, options = { html: true })- label_text = options[:html] ? content_tag('strong', "Visibility") : "Visibility"- activated_text = "set to #{values.last ? 'public' : 'private'}"+ label_text = I18n.t('activerecord.attributes.project.public_value.title')+ label_text = content_tag('strong', label_text) if options[:html]- I18n.t(:text_journal_label_value, label: label_text, value: activated_text)+ value = \+ if values.last+ I18n.t('activerecord.attributes.project.public_value.true')+ else+ I18n.t('activerecord.attributes.project.public_value.false')+ end++ I18n.t(:text_journal_set_to, label: label_text, value:)endenddiff --git a/spec/factories/journal_factory.rb b/spec/factories/journal_factory.rbindex ce3d6889b98..e568e615147 100644--- a/spec/factories/journal_factory.rb+++ b/spec/factories/journal_factory.rb@@ -57,7 +57,7 @@ FactoryBot.define doendfactory :project_journal, class: 'Journal' do- journable_type { 'Project' }+ journable factory: :projectdata { build(:journal_project_journal) }endenddiff --git a/spec/lib/journal_formatter/active_status_spec.rb b/spec/lib/journal_formatter/active_status_spec.rbindex 79dc8023ead..1c6bb1232db 100644--- a/spec/lib/journal_formatter/active_status_spec.rb+++ b/spec/lib/journal_formatter/active_status_spec.rb@@ -29,7 +29,7 @@require 'spec_helper'describe OpenProject::JournalFormatter::ActiveStatus do- let(:instance) { described_class.new(build(:journal)) }+ let(:instance) { described_class.new(build(:project_journal)) }it "renders correctly when unarchiving" dohtml = instance.render("active", [false, true], html: true)diff --git a/spec/lib/journal_formatter/template_spec.rb b/spec/lib/journal_formatter/template_spec.rbindex b6008cfc115..bacf44fc67c 100644--- a/spec/lib/journal_formatter/template_spec.rb+++ b/spec/lib/journal_formatter/template_spec.rb@@ -29,7 +29,7 @@require 'spec_helper'describe OpenProject::JournalFormatter::Template do- let(:instance) { described_class.new(build(:journal, journable: build(:project))) }+ let(:instance) { described_class.new(build(:project_journal)) }it "renders correctly when marked as template" dohtml = instance.render("templated", [false, true], html: true)diff --git a/spec/lib/journal_formatter/visibility_spec.rb b/spec/lib/journal_formatter/visibility_spec.rbindex a30fe0e370a..fa2a0b67878 100644--- a/spec/lib/journal_formatter/visibility_spec.rb+++ b/spec/lib/journal_formatter/visibility_spec.rb@@ -29,7 +29,7 @@require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper.rb")describe OpenProject::JournalFormatter::Visibility do- let(:instance) { described_class.new(build(:journal)) }+ let(:instance) { described_class.new(build(:project_journal)) }it "renders correctly when setting visibility" dohtml = instance.render("public", [nil, true], html: true)