fix: extract translatable headings and paragraphs from workspaces (#27464)
This commit is contained in:
parent
11311b5b25
commit
fd09008e07
1 changed files with 11 additions and 0 deletions
|
|
@ -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"],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue