mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-12 06:01:46 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user