"""Build the constructed comparison file used in the article: our own German
translation of the fixture, pasted as plain paragraphs into a new document,
the way text copied out of a chat window usually lands in Word. It is not
output from DeepL or ChatGPT. One "seat" is deliberately translated as "Sitz"
so the glossary check has something to find.

Usage:
    python3 make_pasted_example.py [output.docx]
"""
import sys
import zipfile

W = 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"'
lines = [
    "Administratorhandbuch für Arbeitsbereiche",
    "Jeder Arbeitsbereich hat mindestens einen Administrator. Ein Administrator kann für jedes neue Mitglied des Arbeitsbereichs eine Lizenz hinzufügen.",
    "Eine Lizenz hinzufügen",
    "Öffnen Sie die Einstellungen des Arbeitsbereichs und wählen Sie Abrechnung. Jede Lizenz wird monatlich abgerechnet.",
    "Rolle | Kann eine Lizenz hinzufügen | Kann den Arbeitsbereich löschen",
    "Inhaber | Ja | Ja",
    "Administrator | Ja | Nein",
    "Eine Lizenz entfernen",
    "Ein Administrator kann einen Sitz jederzeit entfernen. Lesen Sie die Hilfeseite zur Abrechnung, bevor Sie die letzte Administratorlizenz entfernen.",
]
body = "".join(f'<w:p><w:r><w:t xml:space="preserve">{t}</w:t></w:r></w:p>' for t in lines)
document = f'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document {W}><w:body>{body}<w:sectPr/></w:body></w:document>'
content_types = ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'
                 '<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">'
                 '<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>'
                 '<Default Extension="xml" ContentType="application/xml"/>'
                 '<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>'
                 '</Types>')
root_rels = ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'
             '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">'
             '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>'
             '</Relationships>')
out = sys.argv[1] if len(sys.argv) > 1 else "docx-roundtrip-pasted-example.docx"
with zipfile.ZipFile(out, "w", zipfile.ZIP_DEFLATED) as z:
    for name, data in [("[Content_Types].xml", content_types), ("_rels/.rels", root_rels), ("word/document.xml", document)]:
        z.writestr(zipfile.ZipInfo(name, (2026, 10, 21, 0, 0, 0)), data)
print(out)
