From 4efb43d9775224b0cd7fce66d3fb55420ddd7ee9 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 25 Jun 2026 16:21:35 +0530 Subject: [PATCH] chore: rewrite user-facing messages in Projects module Conservative cleanup of frappe.throw/msgprint messages per the message style guide; meaning, severity, and .format() arguments are unchanged: - index bare {} placeholders as {0}/{1}/... so translators can reorder - move f-strings / .format() / concatenation out of _() (they break gettext extraction and never translate) - wrap translatable dynamic values (DocType/Select labels) in _() - fix grammar and colloquialisms - drop no-op _() wrapping runtime-built strings Part of #53976. --- erpnext/projects/doctype/task/task.py | 4 ++-- erpnext/projects/doctype/timesheet_detail/timesheet_detail.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 6cdfd50933a..9eda760a4e7 100755 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -144,7 +144,7 @@ class Task(NestedSet): if frappe.db.get_value("Task", d.task, "status") not in ("Completed", "Cancelled"): frappe.throw( _( - "Cannot complete task {0} as its dependant task {1} are not completed / cancelled." + "Cannot complete task {0} as its dependent task {1} is not completed / cancelled." ).format(frappe.bold(self.name), frappe.bold(d.task)) ) @@ -316,7 +316,7 @@ class Task(NestedSet): def on_trash(self): if check_if_child_exists(self.name): - throw(_("Child Task exists for this Task. You can not delete this Task.")) + throw(_("Child Task exists for this Task. You cannot delete this Task.")) self.update_nsm_model() diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py index dc4c07bf376..0c69d4e1252 100644 --- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py +++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py @@ -105,7 +105,7 @@ class TimesheetDetail(Document): def validate_dates(self): """Validate that to_time is not before from_time.""" if self.from_time and self.to_time and time_diff_in_hours(self.to_time, self.from_time) < 0: - frappe.throw(_("To Time cannot be before from date")) + frappe.throw(_("To Time cannot be before From Time")) def validate_parent_project(self, parent_project: str): """Validate that project is same as Timesheet's parent project."""