feat(02-registration-dictionary-phrases): dictionary-backed registration text

Phase 2 complete:

- Seed registration dictionary phrases

- Update public and admin registration templates to use translations

- Document PAUL plan, apply, summary, and changelog
This commit is contained in:
2026-04-24 21:35:17 +02:00
parent 2cf4715914
commit 6ef8b0029d
13 changed files with 1033 additions and 189 deletions

View File

@@ -0,0 +1,124 @@
---
phase: 02-registration-dictionary-phrases
plan: 01
subsystem: registration
tags: [php, smarty, mysql, dictionary, admin]
requires:
- phase: 01-registration-form-update
provides: updated XXXV Konferencja registration form fields and admin display
provides:
- Dictionary seed for registration phrases
- Public registration templates using dictionary translations
- Confirmation and admin registration views using dictionary translations
affects: [registration, admin-panel, dictionary]
tech-stack:
added: []
patterns: [legacy Smarty dictionary translation, idempotent PHP seed runner]
key-files:
created:
- _rejestracja/sql/2026-04-24-registration-dictionary-phrases.sql
- _rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php
modified:
- _rejestracja/template/partial/Index/Index.tpl
- _rejestracja/template/partial/Index/IndexSent.tpl
- _rejestracja/Admin/template/partial/Calc/Reg.tpl
- _rejestracja/Admin/template/partial/Calc/RegEdit.tpl
key-decisions:
- "Use stable registration_* dictionary keys for implementation phrases instead of raw Polish text keys."
- "Seed Polish replacements and use lang_keyword placeholders for any existing non-Polish dictionary languages."
- "Keep form values, pricing logic, persistence, and payment status values unchanged."
patterns-established:
- "Use Smarty translate helpers with assigned variables for repeated display values like yes/no/missing and participation labels."
- "Use guarded one-off PHP runners for production dictionary/data seeds."
duration: ~9min
started: 2026-04-24T21:16:13+02:00
completed: 2026-04-24T21:25:19+02:00
---
# Phase 2 Plan 01: Registration Dictionary Phrases Summary
Registration wording from the XXXV conference update is now dictionary-backed across the public form, confirmation output, and admin registration views.
## Performance
| Metric | Value |
|--------|-------|
| Duration | ~9 minutes |
| Started | 2026-04-24T21:16:13+02:00 |
| Completed | 2026-04-24T21:25:19+02:00 |
| Tasks | 3 completed |
| Files modified | 4 modified, 2 created |
## Acceptance Criteria Results
| Criterion | Status | Notes |
|-----------|--------|-------|
| AC-1: Dictionary Contains Registration Phrase Set | Pass | Added idempotent SQL and PHP seed runner for the registration phrase set. |
| AC-2: Public Form Uses Dictionary Phrases | Pass | Public form labels/options introduced by the registration update now use `{translate}`. |
| AC-3: Confirmation And Admin Views Use Dictionary Phrases | Pass | Confirmation, admin list, and admin detail views use dictionary-backed labels and display values. |
| AC-4: Existing Registration Behavior Is Preserved | Pass | No controller/model/persistence changes; form names, radio values, pricing logic, and payment status values were preserved. |
## Accomplishments
- Added editable dictionary entries for registration labels, options, yes/no values, missing-value text, participation labels, diet labels, fee labels, and admin action/status text.
- Replaced hard-coded visible phrases in the registration form, confirmation view, admin registration list, and admin registration detail view.
- Preserved the legacy PHP/Smarty architecture and the prior registration behavior from phase 1.
## Files Created/Modified
| File | Change | Purpose |
|------|--------|---------|
| `_rejestracja/sql/2026-04-24-registration-dictionary-phrases.sql` | Created | Idempotent Polish dictionary inserts for registration phrases. |
| `_rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php` | Created | Guarded browser/CLI runner to seed missing dictionary phrases. |
| `_rejestracja/template/partial/Index/Index.tpl` | Modified | Public form labels/options now use dictionary translations. |
| `_rejestracja/template/partial/Index/IndexSent.tpl` | Modified | Confirmation/email labels and display values now use dictionary translations. |
| `_rejestracja/Admin/template/partial/Calc/Reg.tpl` | Modified | Admin registration list labels and display values now use dictionary translations. |
| `_rejestracja/Admin/template/partial/Calc/RegEdit.tpl` | Modified | Admin registration detail/edit labels and payment status labels now use dictionary translations. |
## Verification Results
| Check | Status |
|-------|--------|
| `php -l _rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php` | Pass |
| Hard-coded target phrase scan across public/admin registration templates | Pass; only non-visible `<!-- Zgody -->` comment remains |
| Duplicate keyword scan in PHP seed phrase list | Pass |
| Boundary check for participant controller/model files | Pass; files were not modified |
## Decisions Made
| Decision | Rationale | Impact |
|----------|-----------|--------|
| Use `registration_*` keys | Stable keys are easier to reuse than raw Polish strings with punctuation/HTML variants. | Admin dictionary can edit replacements without coupling to template wording. |
| Seed existing non-Polish languages with placeholders | Mirrors the existing `Dictionary::CheckAndAdd` convention. | Avoids missing rows if the site has more dictionary languages. |
| Replace old visible admin fee deadline text with 2026 dictionary keys | Old templates still contained outdated visible dates. | Admin display aligns with the current conference phrase set while preserving conditions and values. |
## Deviations from Plan
| Type | Count | Impact |
|------|-------|--------|
| Scope addition | 1 | Added `registration_participation_preferences` after verification found one remaining visible admin label. |
| Existing content correction | 1 | Dictionary-backed admin fee labels now show the current 03.10.2026 deadline phrase instead of legacy 2021/2024 visible text. |
## Issues Encountered
| Issue | Resolution |
|-------|------------|
| Legacy templates contain mixed/mojibake text | Touched only the registration phrases in scope and kept unrelated legacy content alone. |
| Unrelated working tree entries existed | Left `_rejestracja/Static/image/Admin/Thumbs.db` and `.vscode/ftp-kr.sync.cache.json` untouched. |
## Next Phase Readiness
**Ready:**
- Registration phrase set can be seeded and edited through `/_rejestracja/Admin/Dictionary/Index`.
- Public and admin registration views consume dictionary translations for targeted phrases.
**Concerns:**
- Production needs the dictionary seed runner or SQL applied before the new keys appear in the admin dictionary.
- Full end-to-end visual verification still depends on live/staging access.
**Blockers:**
- None for this phase.
---
*Phase: 02-registration-dictionary-phrases, Plan: 01*
*Completed: 2026-04-24*