fix: migrate all hardcoded eyebrow labels and text to CMS to fix locale bleeding

This commit is contained in:
MichalC
2026-09-02 22:46:27 +02:00
parent a24c239ae1
commit 6c87816d13
22 changed files with 427 additions and 44 deletions
+50
View File
@@ -0,0 +1,50 @@
import os
import re
blocks_dir = "src/blocks"
blocks_with_eyebrow = [
"Affiliation",
"Eligibility",
"FAQTeaser",
"FinalCTA",
"ServicesList",
"Stats",
]
for block in blocks_with_eyebrow:
component_path = os.path.join(blocks_dir, block, "Component.tsx")
if os.path.exists(component_path):
with open(component_path, "r") as f:
content = f.read()
# Replace `({ title,` with `({ eyebrow, title,`
# Also need to handle cases where there is no space after {
content = re.sub(r'\(\{\s*title', '({ eyebrow, title', content)
with open(component_path, "w") as f:
f.write(content)
# Process block
process = os.path.join(blocks_dir, "Process", "Component.tsx")
with open(process, "r") as f:
content = f.read()
content = re.sub(r'\(\{\s*title', '({ eyebrow, subtitle, title', content)
with open(process, "w") as f:
f.write(content)
# UniqueValue block
uv = os.path.join(blocks_dir, "UniqueValue", "Component.tsx")
with open(uv, "r") as f:
content = f.read()
content = re.sub(r'\(\{\s*title', '({ eyebrow, features, title', content)
with open(uv, "w") as f:
f.write(content)
# ServicesDetailed block
sd = os.path.join(blocks_dir, "ServicesDetailed", "Component.tsx")
with open(sd, "r") as f:
content = f.read()
content = re.sub(r'\(\{\s*title', '({ eyebrow, title', content)
with open(sd, "w") as f:
f.write(content)