diff --git a/frappe/gettext/extractors/custom_fields.py b/frappe/gettext/extractors/custom_fields.py index b4a8dcdb85..2cf902f934 100644 --- a/frappe/gettext/extractors/custom_fields.py +++ b/frappe/gettext/extractors/custom_fields.py @@ -8,6 +8,7 @@ EXCLUDE_SELECT_OPTIONS = [ "minimum_password_score", ] + def extract(fileobj, *args, **kwargs): """ Extract messages from DocType JSON files. To be used to babel extractor @@ -15,7 +16,7 @@ def extract(fileobj, *args, **kwargs): :rtype: `iterator` """ data = json.load(fileobj) - + if not isinstance(data, list): return @@ -37,7 +38,10 @@ def extract(fileobj, *args, **kwargs): if description := field.get("description"): messages.append( - (description, f"Description of the '{_label}' ({fieldtype}) Custom Field in DocType '{doctype}'") + ( + description, + f"Description of the '{_label}' ({fieldtype}) Custom Field in DocType '{doctype}'", + ) ) if message := field.get("options"): diff --git a/frappe/gettext/extractors/customizations.py b/frappe/gettext/extractors/customizations.py index 7ca814cbb9..7425a5e518 100644 --- a/frappe/gettext/extractors/customizations.py +++ b/frappe/gettext/extractors/customizations.py @@ -8,6 +8,7 @@ EXCLUDE_SELECT_OPTIONS = [ "minimum_password_score", ] + def extract(fileobj, *args, **kwargs): """ Extract messages from DocType JSON files. To be used to babel extractor @@ -37,7 +38,10 @@ def extract(fileobj, *args, **kwargs): if description := field.get("description"): messages.append( - (description, f"Description of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'") + ( + description, + f"Description of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'", + ) ) if message := field.get("options"): @@ -59,7 +63,10 @@ def extract(fileobj, *args, **kwargs): ) elif fieldtype == "HTML": messages.append( - (message, f"Content of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'") + ( + message, + f"Content of the '{_label}' ({fieldtype}) field in Customization of DocType '{doctype}'", + ) ) # By using "pgettext" as the function name we can supply the doctype as context