From fd09008e07131023e2cbeccb9b43c2a70e196f7b Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Tue, 20 Aug 2024 23:55:39 +0200 Subject: [PATCH] fix: extract translatable headings and paragraphs from workspaces (#27464) --- frappe/gettext/extractors/workspace.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frappe/gettext/extractors/workspace.py b/frappe/gettext/extractors/workspace.py index 4c58c373be..a9be1dc17c 100644 --- a/frappe/gettext/extractors/workspace.py +++ b/frappe/gettext/extractors/workspace.py @@ -62,3 +62,14 @@ def extract(fileobj, *args, **kwargs): ) for shortcut in data.get("shortcuts", []) ) + + content = json.loads(data.get("content", "[]")) + for item in content: + item_type = item.get("type") + if item_type in ("header", "paragraph"): + yield ( + None, + "_", + item.get("data", {}).get("text"), + [f"{item_type.title()} text in the {workspace_name} Workspace"], + )