snapshot: preserve bilingual PDF text phase

This commit is contained in:
Md Bayazid Bostame
2026-03-24 13:57:27 +01:00
parent 5265b8f3e2
commit 26096449aa
8 changed files with 1234 additions and 65 deletions

View File

@@ -136,6 +136,8 @@ docker compose exec -T web django-admin compilemessages</code></pre>
<li>PDF generation is HTML-to-PDF using <code>xhtml2pdf</code>.</li>
<li>Letterhead overlay is applied from <code>templates.pdf</code>.</li>
<li>Main logic lives in <code>backend/workflows/tasks.py</code>.</li>
<li>Fixed PDF labels/headings are rendered from task-level DE/EN text dictionaries, not hard-coded directly in request processing logic.</li>
<li>PDF language follows the normalized request <code>preferred_language</code>, with German fallback.</li>
<li>Key templates:
<ul>
<li><code>onboarding_template.html</code></li>

View File

@@ -139,6 +139,7 @@
<li>Additional onboarding intro template: <code>/backend/media/templates/onboarding_intro_template.html</code>.</li>
<li>Letterhead: <code>/backend/media/templates/templates.pdf</code>.</li>
<li>Output folder: <code>/backend/media/pdfs/</code>.</li>
<li>Fixed PDF labels and notes are rendered through task-level DE/EN text maps and follow the request language with German fallback.</li>
<li>Signature images are embedded for compatibility with xhtml2pdf rendering.</li>
<li>Conditional sections are hidden if no data is provided.</li>
<li>Offboarding fallback behavior: if no onboarding record is available, the PDF renders a manual onboarding review layout grouped into <code>Stammdaten</code>, <code>Vertrag</code>, <code>IT-Setup</code>, and <code>Abschluss</code>, plus checkbox grids for devices, software, accesses, workspace groups, resources, and additional IT items.</li>
@@ -169,8 +170,9 @@
<li><strong>Email phase added:</strong> admin-managed notification template subject/body content, notification rule custom subject/body content, and welcome email subject/body content now support explicit DE/EN values.</li>
<li><strong>Runtime selection:</strong> onboarding and offboarding requests store the UI language at submission time, and notification delivery uses that language with German fallback.</li>
<li><strong>Stability hardening:</strong> request models normalize <code>preferred_language</code> on save, and the database schema also enforces a default of <code>de</code>. This prevents null-language inserts outside the main form/view path.</li>
<li><strong>PDF phase added:</strong> fixed PDF headings, labels, notes, and confirmation text now render in German or English based on the request language, with German as the fallback.</li>
<li><strong>Editing path:</strong> these DE/EN values are maintained directly in the frontend builder pages, not only in Django admin.</li>
<li><strong>Not fully bilingual yet:</strong> several generated PDF/business text blocks still remain primarily single-language.</li>
<li><strong>Not fully bilingual yet:</strong> the main remaining gaps are long-form handbook/wiki copy and a few secondary admin/help texts.</li>
<li><strong>Implementation:</strong> Django i18n with locale middleware, translation catalogs, and a DE/EN language switch in the main UI.</li>
</ul>