"""One-off seed: Hinglish (romanized Hindi-English code-switch) translations
for the 313 "help" namespace keys registered by seed_translations_help_phase2.py
(the ~145-page Phase 2 PageInfoButton rollout). Run seed_translations_help_phase2.py
FIRST so these keys already exist — this script only inserts translation_values.

Usage: docker compose exec api python seed_translations_help_phase2_hinglish.py
"""
import asyncio
import uuid
from datetime import datetime, timezone

from sqlalchemy import text
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine

from ams.core.config import settings

NAMESPACE = "help"
LANGUAGE_CODE = "hinglish"

PAGES_HINGLISH = {
    # finance
    "capitalization-queue": ("Asset Capitalization Queue", [
        "Commissioning ke liye pending assets, jo active depreciation ledgers mein capitalize karne ke liye ready hain.",
    ]),
    "capitalization-review": ("Capitalization Review", [
        "Commissioning ke liye pending assets ka detailed review, full lifecycle history ke saath.",
    ]),
    "depreciation-exceptions": ("Depreciation Reconciliation", [
        "Ek period ke liye teen depreciation books mein net book value compare karein aur exceptions ko surface karein.",
    ]),
    "depreciation-master": ("Depreciation Master", [
        "Har asset class, book, aur fiscal year ke liye government-mandated depreciation rates.",
    ]),
    "depreciation-run-wizard": ("Depreciation Run", [
        "Ek monthly period ke liye three-book depreciation run karein.",
        "Idempotent — same period ko dobara run karne par entries recalculate hoke overwrite ho jati hain.",
    ]),
    "finance-dashboard": ("Finance", [
        "Depreciation, journals, budgets, aur investment planning.",
        "Per-asset financial actions har asset ke Financials tab par milte hain.",
    ]),
    "financial-reconciliation": ("Depreciation Book Reconciliation", [
        "Companies Act, Income Tax, aur Ind AS books ke closing net book value aur depreciation ko compare karein.",
    ]),
    "journal-export": ("Journal Export", [
        "Ek period aur book ke liye depreciation aur financial journal entries export karein.",
    ]),
    "nbv-dashboard": ("Net Book Value — PPE Movement", [
        "Fiscal year ke liye har asset class ke hisaab se opening net book value, additions, disposals, depreciation, aur closing value.",
    ]),
    "capital-plan": ("Capital Plan Registry", [
        "Long-term (10/20/30-year) CapEx forecast scenarios.",
    ]),
    "create-scenario": ("Create Investment Scenario", [
        "Ek chuni hui timeframe ke liye assets ke set ke liye repair-vs-replace NPV/TCO analysis run karein.",
    ]),
    "npv-analysis": ("Renewal Recommendations", [
        "Poor ya critical condition mein high-criticality assets — repair-vs-replace NPV analysis ke candidates.",
    ]),
    "scenario-review": ("Investment Scenario Review", [
        "Har asset ke liye repair-vs-replace results, plus ek ISO 55001-aligned SAMP capital plan export.",
    ]),
    "tco-analysis": ("Total Cost of Ownership", [
        "Scenario ke assets ke liye repair/replace options ke beech TCO comparison.",
    ]),
    "budget-allocation": ("Budget Allocation", [
        "Budget lines create karein aur unhe approve karein.",
        "Maker-checker — approver, creator se different hona chahiye.",
    ]),
    "budget-impact": ("Budget Impact", [
        "Year-end forecast (year-to-date actuals plus commitments plus burn rate) aur budget-vs-actual variance.",
    ]),
    "virement-approvals": ("Budget Virement", [
        "Approved budget ko ek head se doosre head mein transfer karne ki request karein — ek different user ko approve karna hoga.",
        "Isme PFMS sync aur zero-based budgeting tools bhi shamil hain.",
    ]),
    "executive-dashboard": ("Executive Management Dashboard", [
        "KPI overview jo accumulated depreciation, budget utilisation, ISO 55001 readiness, aur expired warranty count ko combine karta hai, CFO aur auditor dashboard APIs se live pull kiya gaya.",
        "Current period ke CFO dashboard ko download karne ke liye Export Dashboard use karein.",
    ]),
    "asset-value-analysis": ("Asset Valuation & Depreciation Suite", [
        "Asset class ke hisaab se net book value, saath hi total accumulated depreciation (Companies Act) aur commissioning ke liye abhi bhi pending assets.",
        "Revaluations ya schedule changes ke liye dedicated depreciation module kholne ke liye \"Manage Depreciation Master\" use karein.",
    ]),
    "budget-utilization": ("Budget Utilization Dashboard", [
        "Approved budget ko actual spend se compare karta hai aur poore organization mein resulting utilisation percentage dikhata hai.",
        "Per-department budget lines mein drill karne ke liye \"Manage Department-Level Budget Allocations\" use karein.",
    ]),
    "compliance-status": ("Compliance Status Dashboard", [
        "ISO 55001 readiness score, uncustodied assets ka count, aur 30 din mein expire hone wale documents, plus agle 30 dinon ke upcoming compliance deadlines ka table.",
        "Individual compliance events aur evidence manage karne ke liye \"Open Compliance Center\" use karein.",
    ]),

    # custody
    "custody-acknowledgements": ("Pending Acknowledgements", [
        "Wo assets jinhe unke custodian ne is fiscal year mein abhi tak dobara acknowledge nahi kiya hai.",
    ]),
    "asset-transfer": ("Custody Transfer Workflow", [
        "Dual sign-off transfer: pehle initiate karein, phir outgoing custodian asset release karta hai aur incoming custodian use accept karta hai.",
    ]),
    "custody-assigned-assets": ("Assigned Assets", [
        "Kisi bhi custodian ko kabhi bhi assign kiya gaya har asset, uske current status ke saath.",
    ]),
    "custody-bulk-reassign": ("Bulk Reassign Custody", [
        "Ek hi action mein multiple assets ko ek custodian se dusre custodian ko move karein.",
    ]),
    "custody-history": ("Custody History", [
        "Selected asset ki poori chain-of-custody.",
    ]),
    "custody-investigations": ("Audit Investigations", [
        "Custody disputes, mismatches, aur baaki flagged asset events.",
    ]),
    "custody-liability-report": ("Assets in a Person's Care", [
        "Ye person abhi jo bhi hold kar raha hai, aur har item ki value kya hai.",
    ]),
    "custody-temp-assignments": ("Temporary Custody Assignments", [
        "Automatic expiry date ke saath short-term custody assign karein.",
    ]),
    "asset-portfolio": ("Asset Portfolio", [
        "Enterprise physical assets ka live ledger view, valuation aur risk profiles ke saath.",
    ]),
    "auditor-dashboard": ("Auditor Dashboard", [
        "Compliance, audit log, aur ISO 55001 readiness — read-only.",
    ]),
    "ca-dashboard": ("CA Financial Dashboard", [
        "Asset-wise valuation, sabhi 3 statutory books mein depreciation, aur compliance readiness — read-only.",
    ]),
    "custodian-dashboard": ("Custodian Dashboard", [
        "Aapke assigned assets, pending transfers, aur pending acknowledgements.",
        "Neeche records dekhne ke liye kisi bhi card par click karein.",
    ]),
    "planning-dashboard": ("Planning Dashboard", [
        "Strategic asset portfolio planning, lifecycle scenario building, aur financial forecasting.",
    ]),
    "scenario-comparison": ("Capex Scenario Comparison", [
        "Side by side compare karne ke liye 3 tak logged capex scenarios select karein.",
    ]),
    "ai-intelligence": ("AAMS AI Intelligence", [
        "Predictive maintenance, anomaly detection, aur asset lifecycle intelligence.",
    ]),
    "verification-plans": ("Physical Verification Plans", [
        "Records ke against assets ko physically check karne ke liye verification plans banayein, aur verify karein ki audit log ki integrity ke saath koi tampering nahi hui hai.",
    ]),
    "asset-audit-findings": ("Audit Findings", [
        "Audit findings — observations, severity, aur corrective actions — ko resolve hone tak log aur track karein.",
    ]),
    "audit-history-registry": ("Audit History Registry", [
        "Har audit log event ka searchable record, sanitized copy export karne ke tools ke saath.",
    ]),
    "audit-timeline": ("Audit Timeline", [
        "Audit events ki chronological timeline, resource type ke hisaab se filter karne yogya.",
    ]),
    "compliance-center": ("Compliance Center", [
        "Document expiry monitoring, statutory calendar, aur ISO 55001 organisational readiness.",
    ]),
    "iso-55001-readiness": ("ISO 55001 Readiness Checklist", [
        "Scored compliance checklist ke saath ISO 55001 asset management standard ke against progress track karein.",
    ]),
    "risk-assets": ("Risk Assets", [
        "High-criticality assets (criticality score 3 ya usse zyada) jinhe attention chahiye.",
    ]),
    "security-vapt": ("Security & VAPT Governance", [
        "Vulnerability findings, scans, framework assessments, security controls, aur login/session events.",
    ]),
    "dashboard-config": ("Dashboard Configuration", [
        "Apne executive dashboard layout ko personalize karein.",
        "Is browser mein save hota hai.",
    ]),
    "department-masters": ("Departments", [
        "Department ek \"department\" type ka organisation unit hota hai.",
    ]),
    "generic-masters": ("Generic Masters", [
        "Kisi bhi generic master table ko browse aur maintain karein — is page ke selector se ek choose karein.",
    ]),
    "master-dashboard": ("Master Data Dashboard", [
        "Master data categories ke across live record counts.",
        "Uske records browse karne ke liye ek category select karein.",
    ]),

    # vendor-contracts
    "create-grn": ("Goods Receipt Note", [
        "Kisi open purchase order ke against jo maal actually aaya hai usko record karein.",
    ]),
    "invoice-verification": ("Invoice Verification", [
        "3-way match: invoice vs purchase order vs goods receipt note.",
    ]),
    "po-approvals": ("PO Approval Queue", [
        "Purchase orders jo approval decision ke liye pending hain.",
    ]),
    "pr-approvals": ("PR Approval Queue", [
        "Purchase requisitions jo approval decision ke liye pending hain.",
    ]),
    "procurement-history": ("Procurement History", [
        "Requisitions aur purchase orders ka combined transaction log.",
    ]),
    "procurement": ("Procurement Dashboard", [
        "Poori organization mein requisition aur purchase order activity.",
    ]),
    "purchase-orders": ("Purchase Orders", [
        "Vendors ko issue kiye gaye har purchase order ka register, draft se leke closure tak.",
    ]),
    "purchase-requisitions": ("Purchase Requisitions", [
        "Purchase order banne se pehle ke internal purchase requests ka register.",
    ]),
    "quotation-comparison": ("Quotation Comparison", [
        "Vendor quotations ko side-by-side compare karein aur RFQ award karein.",
    ]),
    "rfq-management": ("RFQ Management", [
        "Approved purchase requisitions ke liye vendors se quotations solicit karein.",
    ]),
    "purchase-order-detail": ("Purchase Order Details", [
        "Ek single purchase order ka full detail view — line items, approval status, linked goods receipts aur invoices.",
    ]),
    "purchase-requisition-detail": ("Purchase Requisition Details", [
        "Ek single purchase requisition ka full detail view — requested items, approval status aur linked purchase order.",
    ]),
    "rfq-detail": ("RFQ Details", [
        "Ek single RFQ ka full detail view — invited vendors, submitted quotations aur comparison.",
    ]),
    "goods-receipt-register": ("Goods Receipt Register", [
        "Incoming stock receipts ko record aur review karein.",
    ]),
    "inventory-allocations": ("Inventory Allocations", [
        "User ko allocate kiye gaye inventory items ka track rakhein, har item ke available stock tak capped.",
    ]),
    "inventory-dashboard": ("Inventory Dashboard", [
        "Stock items, low-stock alerts, valuation aur recent movements ka live overview.",
    ]),
    "inventory-history": ("Inventory Transaction History", [
        "Stock movements ka full audit trail — receipts, issues, transfers, adjustments, returns.",
    ]),
    "inventory-register": ("Inventory Item Register", [
        "Reorder rules aur stock actions ke saath inventory items ki master list.",
    ]),
    "inventory-reports": ("Inventory Reports", [
        "Current stock levels se live compute kiye gaye low-stock alerts aur inventory valuation.",
    ]),
    "inventory-requests": ("Inventory Requests", [
        "Requesters ko inventory items requisition, approve aur issue karein.",
    ]),
    "physical-verification": ("Physical Verification", [
        "Scheduled aur completed inventory audits, variance reconciliation ke saath.",
    ]),
    "warehouse-management": ("Stock by Location", [
        "Har item ka real stock level, location ke hisaab se grouped.",
        "Is system mein alag warehouse/bin model nahi hai — location seedha Locations master ka reference hai.",
    ]),
    "advanced-reports": ("Advanced Standard Reports", [
        "Custodian exceptions, warranty exposure, transfer history aur OData feeds.",
    ]),
    "cag-report-pack": ("CAG Report Pack", [
        "Ek given fiscal period ke liye consolidated asset register, depreciation schedule aur custodian register.",
        "On demand generate hota hai aur XLSX/PDF ke roop mein deliver kiya jaata hai.",
    ]),
    "document-reports": ("Document Expiry Report", [
        "Selected window ke andar expire ho rahe ya overdue asset documents.",
    ]),
    "drill-down-reports": ("Drill Down Reports", [
        "Underlying asset ledger ke against real-time drill-down queries.",
    ]),
    "planning-reports": ("Planning Reports & History", [
        "CapEx forecast scenarios aur asset renewal recommendations.",
    ]),
    "report-builder": ("Report Builder", [
        "Data source pick karein, columns aur filters choose karein, preview karein, phir export karein.",
    ]),
    "reports-analytics": ("AAMS Reports & Analytics", [
        "Standard reports, KPI analytics, custom reports aur scheduled exports.",
    ]),
    "reports": ("AAMS General Reports & Analytics", [
        "CFO dashboard aur asset register se live asset ledger analytics.",
    ]),
    "scheduled-reports": ("Scheduled Reports", [
        "Automated recurring report distribution manage karein.",
    ]),

    # master-data — MasterListViews.tsx (11 pages)
    "location-masters": ("Location Master Registers", [
        "Facility domains, floor boundaries, aur office workspaces ko configure aur manage karein.",
    ]),
    "document-masters": ("Document Masters", [
        "Legal compliance documents, guarantees, insurance, aur retention covenants configure karein.",
    ]),
    "approval-queue": ("Master Approvals Queue", [
        "Har governed master table ke across maker-checker queue — approver kabhi bhi wahi user nahi ho sakta jisne record create kiya ho (GFR Rule 21).",
        "Yahan koi \"reject\" action nahi hai; kisi change ko decline karne ka matlab hai use unapproved chhod dena.",
    ]),
    "master-records": ("Master Data Records", [
        "Operational ledger sheets mein use hone wali core classification categories ka consolidated repository.",
    ]),
    "asset-classes": ("Asset Classes", [
        "Asset groupings, depreciation parameters, aur standardized operational lives configure karein.",
    ]),
    "asset-categories": ("Asset Categories", [
        "Asset Class ke sub-groups — maker-checker approval ke through governed.",
    ]),
    "asset-subcategories": ("Asset Sub-Categories", [
        "Asset Category ke andar finer-grained groupings.",
    ]),
    "vendor-masters": ("Vendor Masters Registry", [
        "Authorized enterprise suppliers, maintenance vendors, aur spare-parts deliverers ki registry.",
    ]),
    "tax-masters": ("Tax Masters", [
        "GST rate slabs aur HSN/SAC code lookups.",
        "Read-only — GSTN sync (Financial Masters page) ke through maintain hota hai, yahan edit nahi hota.",
    ]),
    "validation-errors": ("Check a Bulk Upload", [
        "Assets ki spreadsheet upload ki thi? Uska reference number niche paste karein taaki dekh sakein kaunse rows successfully gaye aur kaunsi mein problem thi, taaki aap un rows ko fix karke dobara upload kar sakein.",
    ]),
    "financial-masters": ("Financial Masters", [
        "Chart of accounts, cost centres, aur fiscal period calendar.",
        "Accounts aur fiscal periods GSTN/finance system sync ke through maintain hone wale read-only lookups hain; cost centres yahan create kiye ja sakte hain.",
    ]),

    # administration
    "executive-history": ("Executive History", [
        "Real system audit trail — har mutating API call, hash-chained aur tamper-evident.",
    ]),
    "permission-catalog": ("Permission Catalog", [
        "Har module ke across permissions ki full list — same catalog jo Role Create/Edit se pull hota hai.",
    ]),
    "roles": ("Role Management", [
        "System ke across security roles ka register aur har role jo permissions grant karta hai.",
    ]),
    "users": ("User Management", [
        "Enterprise users, unke roles, status, aur access manage karein.",
    ]),
    "settings": ("Settings", [
        "Application branding, map provider, aur security policy configuration.",
    ]),
    "roles-create": ("Create Role", [
        "Naya security role define karein aur wo kaunsi permissions grant karega.",
    ]),
    "roles-edit": ("Edit Security Role", [
        "Role ka naam, description, ya permissions change karein.",
    ]),
    "role-detail": ("Inspect Security Profile", [
        "Role ki permissions aur currently usko assign kiye gaye users ka read-only view.",
    ]),
    "role-permissions-edit": ("Edit Permissions", [
        "Is role ke liye individual permissions assign ya remove karein.",
    ]),
    "users-create": ("Create User", [
        "Specific role-based permissions aur credentials ke saath naya enterprise user account register karein.",
    ]),
    "users-edit": ("Edit User", [
        "Selected enterprise user ke liye account details, role assignments, aur directory status update karein.",
    ]),
    "user-detail": ("User Details", [
        "Is enterprise directory identity ke liye read-only profile verification aur security descriptors.",
    ]),

    # maintenance
    "asset-inspection-register": ("Asset Inspection Register", [
        "Sabhi asset inspections ka log jo perform ki gayi, schedule ki gayi, aur pending hain.",
    ]),
    "assigned-work-orders": ("Assigned Work Orders", [
        "Repair ya maintenance ke liye technicians ko assign kiye gaye work orders.",
    ]),
    "breakdown-register": ("Breakdown Register", [
        "Reported equipment aur asset breakdowns jo repair ke wait mein ya under repair hain.",
    ]),
    "pm-schedule": ("Preventive Maintenance (PM) Schedule", [
        "Time ya usage intervals ke basis par assets ke liye scheduled recurring maintenance.",
    ]),
    "service-evidence": ("Service Evidence Repository", [
        "Work order ke asset se attach kiye gaye photos, videos, aur documents.",
    ]),
    "technician-dashboard": ("Technician Dashboard", [
        "Aapko assign kiye gaye work orders, inspections, aur breakdowns.",
    ]),
    "work-order-detail": ("Work Order Details", [
        "Ek single work order ka full detail view — assigned technician, status, aur linked asset.",
    ]),
    "asset-inspection-detail": ("Asset Inspection Details", [
        "Ek single asset inspection record ka full detail view.",
    ]),
    "pm-schedule-detail": ("PM Schedule Details", [
        "Ek single preventive maintenance schedule entry ka full detail view.",
    ]),
    "breakdown-detail": ("Breakdown Details", [
        "Ek single reported breakdown ka full detail view.",
    ]),

    # organisation
    "hrms-sync": ("Directory Sync", [
        "Apne departments aur people ko hath se add karne ke bajaye, apne HR aur identity systems se automatically le aayein.",
        "Settings mein source on karein aur uske details enter karein, phir yahan sync run karein.",
    ]),
    "org-units-assign": ("Approval Delegation Matrix", [
        "Ek org unit ke andar kisi role ko approval authority delegate karein, saath mein ek optional monetary limit ke.",
    ]),
    "org-units": ("Organisation Units Master", [
        "Organisation ki department aur unit hierarchy manage karein — yahan se har unit create, edit, aur organise karein.",
    ]),
    "org-units-add": ("Add New Organisation Unit", [
        "Ek naya department, division, ya doosra organisational unit create karein aur use hierarchy mein place karein.",
    ]),
    "org-units-hierarchy": ("Company Hierarchy Visualizer", [
        "Har organisation unit doosron se kaise related hai, uska visual tree.",
    ]),
    "org-unit-detail": ("Organisation Unit Details", [
        "Ek single organisation unit ka full detail view — uska type, parent, aur members.",
    ]),

    # assets
    "asset-appreciation": ("Asset Appreciation", [
        "Land ya Investment Property jaise asset classes ke liye capital appreciation record karein, jinki value time ke saath badhne ki expectation hai.",
        "Ye Asset Revaluation jaisa hi revaluation record use karta hai, bas upward moves tak restricted.",
    ]),
    "asset-creation-queue": ("Asset Creation Queue", [
        "Real stock-in receipts ko formalized asset entries mein convert karein.",
    ]),
    "disposal-approvals": ("Asset Disposal Queue", [
        "Decommission approval ke pending assets, aur disposal history.",
    ]),
    "asset-register": ("Asset Register", [
        "Organization ke har tracked asset ki master list, lifecycle state, location, aur quick actions ke saath.",
    ]),
    "asset-revaluation": ("Asset Revaluation", [
        "IAS 16 guidelines ke compliance mein physical assets ke recognized balances adjust karein.",
    ]),
    "asset-detail": ("Asset Details", [
        "Ek single asset ka full detail view — specifications, custody, documents, financials, aur history, tabs ke across.",
    ]),
    "assets-create": ("Create / Edit Asset", [
        "Ek naya asset register karein ya existing asset edit karein — classification, specifications, location, aur initial custody.",
    ]),

    # small misc modules
    "ai-copilot": ("AI Copilot", [
        "Aapka asset management ke liye intelligent assistant — read-only hai.",
    ]),
    "document-dashboard": ("Document Intelligence", [
        "Poore register mein OCR coverage, aur SharePoint sync status.",
    ]),
    "document-repository": ("Document Repository Search", [
        "Register ke har document mein full-text search karein.",
        "Results aapke organisational unit tak scoped hote hain.",
    ]),
    "expiry-renewal": ("Document Expiry & Retention", [
        "Expiry checker dwara already raise kiye gaye alerts, aur retention window paar kar chuke documents jo action ka wait kar rahe hain.",
    ]),
    "geo-workspace": ("Geo Workspace", [
        "GPS reference points, geofences, aur spatial asset queries.",
        "Ek single asset ki apni position uske Location tab par hoti hai.",
    ]),
    "help": ("AAMS Help Center", [
        "Har module ke liye system guidelines, workflows aur step-by-step guides.",
    ]),
    "hr-exit-processing": ("HR Exit Processing", [
        "Departing employees ke orphan custody assignments, aur interim custodian acceptance ka wait kar rahe assets ko track karein.",
    ]),
    "label-workspace": ("Label Workspace", [
        "Print templates, bulk label generation, unmapped label pool, aur coverage stats.",
        "Kisi specific asset ko label assign karna uske Labels tab par hota hai.",
    ]),
    "notifications": ("Notification Center", [
        "Inbox, channel opt-in/out preferences, aur safety-alert admin tools.",
    ]),
    "dynamic-fields": ("Dynamic Fields & Forms", [
        "Har module ke liye custom fields, validation rules, form layouts, aur value bulk import.",
    ]),
    "feature-flags": ("Feature Flags & Module Management", [
        "Microservice modules, gradual rollout wale feature flags, tenant overrides, aur service health.",
    ]),
    "platform-admin": ("Platform Administration", [
        "Tenant provisioning aur live system health.",
    ]),
    "system-configuration": ("System Configuration", [
        "System parameters, feature toggles, aur lookup code masters.",
    ]),
    "asset-verification": ("Asset Verification", [
        "Asset registry aur tag/RFID-based physical verification.",
    ]),
    "tag-management": ("Tag Management", [
        "Apne assets ke QR / barcode / RFID tags manage karein.",
        "Ek saath kai assets ke liye tags banayein, jo assets apni jagah se move ho gaye hain unhe dhundein, aur tags verify karein.",
    ]),
    "verification-cycles": ("Verification Cycles", [
        "Physical asset verification cycles.",
        "Poore workflow ke liye ek cycle open karein.",
    ]),
    "tickets": ("Support Tickets", [
        "Saare support requests, incidents, aur change tickets manage karein.",
    ]),
    "user-profile": ("My Profile", [
        "Aapki personal profile, employee details, aur account security settings.",
    ]),
    "workflow-approvals": ("Workflow Approvals", [
        "Pending approvals, instance history, delegated authority, aur SLA performance.",
    ]),
    "workflow-templates": ("Workflow Templates", [
        "Module/trigger event ke hisaab se approval chains — steps, approvers, aur SLAs — define karein.",
    ]),
}


def build_values() -> dict:
    values = {}
    for page_key, (title, body) in PAGES_HINGLISH.items():
        values[f"{page_key}.title"] = title
        for i, paragraph in enumerate(body):
            values[f"{page_key}.body.{i}"] = paragraph
    return values


async def seed_translation_values(session: AsyncSession, values: dict) -> tuple[int, list[str]]:
    now = datetime.now(timezone.utc)
    inserted = 0
    unmatched = []
    for key, value in values.items():
        key_id = (await session.execute(
            text("SELECT id FROM translation_keys WHERE namespace = :ns AND key = :key"),
            {"ns": NAMESPACE, "key": key},
        )).scalar_one_or_none()
        if not key_id:
            unmatched.append(key)
            continue

        existing = (await session.execute(
            text("SELECT id FROM translation_values WHERE key_id = :kid AND language_code = :lc"),
            {"kid": key_id, "lc": LANGUAGE_CODE},
        )).scalar_one_or_none()
        if existing:
            await session.execute(
                text("UPDATE translation_values SET value = :val, updated_at = :now WHERE id = :id"),
                {"val": value, "now": now, "id": existing},
            )
        else:
            await session.execute(
                text("""INSERT INTO translation_values (id, key_id, language_code, value, updated_by, updated_at)
                        VALUES (:id, :kid, :lc, :val, NULL, :now)"""),
                {"id": str(uuid.uuid4()), "kid": key_id, "lc": LANGUAGE_CODE, "val": value, "now": now},
            )
            inserted += 1

    await session.commit()
    return inserted, unmatched


async def main() -> None:
    values = build_values()
    engine = create_async_engine(settings.DATABASE_URL, echo=False)
    Session = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)

    async with Session() as session:
        tenants = (await session.execute(
            text("SELECT id::text AS id, slug FROM public.tenants WHERE status != 'archived'")
        )).fetchall()

    for tenant in tenants:
        schema = f"tenant_{tenant.id.replace('-', '_')}"
        async with Session() as session:
            await session.execute(text(f"SET search_path TO {schema}, public"))
            try:
                inserted, unmatched = await seed_translation_values(session, values)
                note = f" ({len(unmatched)} unmatched)" if unmatched else ""
                print(f"  seeded {inserted} new {LANGUAGE_CODE} values{note}: {tenant.slug}")
            except Exception as exc:
                print(f"  SKIPPED {tenant.slug}: {exc}")
                await session.rollback()

    await engine.dispose()
    print(f"Done — {len(tenants)} tenant(s) processed, {len(PAGES_HINGLISH)} pages / {len(values)} values.")


if __name__ == "__main__":
    asyncio.run(main())
