From f70506fc92a3b149d71ede3abd879d7ee6ce6535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fancan?= <37839267+doancan@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:04:39 +0300 Subject: [PATCH] refactor: update default_success_action.py The _(doctype) inside get_message is removed from the .format() method. The reason is that _(doctype) would attempt to translate the doctype itself, which is generally not required since the doctypes in doctype_list are system-level terms. The main string "{0} has been submitted successfully" should be translated, and then it should receive the doctype name as an argument. (cherry picked from commit 804558e5bf6ecb6cad54c22233728b50bc5f2fb7) --- erpnext/setup/default_success_action.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/default_success_action.py b/erpnext/setup/default_success_action.py index 2b9e75c3265..dba20548184 100644 --- a/erpnext/setup/default_success_action.py +++ b/erpnext/setup/default_success_action.py @@ -11,14 +11,17 @@ doctype_list = [ def get_message(doctype): - return _("{0} has been submitted successfully").format(_(doctype)) + # Properly format the string with translated doctype + return _("{0} has been submitted successfully").format(doctype) def get_first_success_message(doctype): + # Reuse the get_message function for consistency return get_message(doctype) def get_default_success_action(): + # Loop through each doctype in the list and return formatted actions return [ { "doctype": "Success Action",