fix: extract translatable headings and paragraphs from workspaces (#27464)

This commit is contained in:
Raffael Meyer 2024-08-20 23:55:39 +02:00 committed by GitHub
parent 11311b5b25
commit fd09008e07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"],
)