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

fix i18n keys for duration

Christophe Bliard90a8329c3a00
diff --git a/app/contracts/work_packages/base_contract.rb b/app/contracts/work_packages/base_contract.rb
index f3742638226..62ea0acc5a8 100644
--- a/app/contracts/work_packages/base_contract.rb
+++ b/app/contracts/work_packages/base_contract.rb
@@ -318,7 +318,7 @@ module WorkPackages
end
def validate_duration_integer
- errors.add :duration, :only_integer if model.duration_before_type_cast != model.duration
+ errors.add :duration, :not_an_integer if model.duration_before_type_cast != model.duration
end
def validate_duration_matches_dates
diff --git a/config/locales/en.yml b/config/locales/en.yml
index ff46a4759b4..021b99f3389 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -578,6 +578,7 @@ en:
begin_deletion: "Begin of the deletion"
children: "Subelements"
done_ratio: "Progress (%)"
+ duration: "Duration"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
version: "Version"
diff --git a/spec/contracts/work_packages/base_contract_spec.rb b/spec/contracts/work_packages/base_contract_spec.rb
index 58bd48025d6..557a82f9781 100644
--- a/spec/contracts/work_packages/base_contract_spec.rb
+++ b/spec/contracts/work_packages/base_contract_spec.rb
@@ -498,7 +498,7 @@ describe WorkPackages::BaseContract do
work_package.duration = 4.5
end
- it_behaves_like 'contract is invalid', duration: :only_integer
+ it_behaves_like 'contract is invalid', duration: :not_an_integer
end
context 'when setting the duration to a negative value' do