mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 07:28:39 +00:00
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:
@@ -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:
|
||||
|
||||
@@ -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>"
|
||||
)
|
||||
|
||||
|
||||
@@ -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"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user