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.
This commit is contained in:
Doğancan
2024-09-19 08:04:39 +03:00
committed by ruthra kumar
parent 444f085fc5
commit 804558e5bf

View File

@@ -11,14 +11,17 @@ doctype_list = [
def get_message(doctype): 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): def get_first_success_message(doctype):
# Reuse the get_message function for consistency
return get_message(doctype) return get_message(doctype)
def get_default_success_action(): def get_default_success_action():
# Loop through each doctype in the list and return formatted actions
return [ return [
{ {
"doctype": "Success Action", "doctype": "Success Action",