chore: rewrite user-facing messages in Utilities 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:
Mihir Kandoi
2026-06-25 16:22:04 +05:30
parent 7124e47490
commit 10744d1332
3 changed files with 6 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ def get_site_info(site_info):
def payment_app_import_guard():
marketplace_link = '<a href="https://frappecloud.com/marketplace/apps/payments">Marketplace</a>'
github_link = '<a href="https://github.com/frappe/payments/">GitHub</a>'
msg = _("payments app is not installed. Please install it from {} or {}").format(
msg = _("payments app is not installed. Please install it from {0} or {1}").format(
marketplace_link, github_link
)
try:

View File

@@ -30,7 +30,7 @@ def transaction_processing(
skipped_msg += (
"<br><br><ul>"
+ "".join(_("<li>{}</li>").format(frappe.bold(row.get("name"))) for row in skipped_records)
+ "".join(_("<li>{0}</li>").format(frappe.bold(row.get("name"))) for row in skipped_records)
+ "</ul>"
)

View File

@@ -30,6 +30,8 @@ class VideoSettings(Document):
try:
build("youtube", "v3", developerKey=self.api_key)
except Exception:
title = _("Failed to Authenticate the API key.")
self.log_error("Failed to authenticate API key")
frappe.throw(title + " Please check the error logs.", title=_("Invalid Credentials"))
frappe.throw(
_("Failed to authenticate the API key. Please check the error logs."),
title=_("Invalid Credentials"),
)