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

@@ -15,3 +15,15 @@ The changes must be persisted in the database and visible in the administrator p
- Preserve existing pricing/admin content management behavior unless explicitly changed by the plan.
- Treat database schema changes as deployment-critical and document them in SQL.
## Validated
- Registration form, persistence, confirmation output, and administrator display were updated for the XXXV conference request - Phase 1.
- New and related registration phrases are dictionary-backed and editable from `/_rejestracja/Admin/Dictionary/Index` after applying the dictionary seed - Phase 2.
## Key Decisions
| Date | Decision | Impact |
|------|----------|--------|
| 2026-04-24 | Use stable `registration_*` dictionary keys for registration-specific phrases. | Templates can reuse dictionary labels without depending on raw Polish text as keys. |
| 2026-04-24 | Keep form values, participant persistence, pricing logic, and payment status values unchanged while moving labels to dictionary. | Reduces risk to the completed registration flow. |
---
*Last updated: 2026-04-24 after Phase 2*

View File

@@ -4,6 +4,8 @@
Status: Complete
Progress: 2 of 2 phases complete (100%)
### Phase 1: Registration Form Update
Status: Complete
@@ -11,3 +13,13 @@ Goal: Align the public registration form, persisted participant data, confirmati
Planned:
- `01-01`: Complete - updated registration fields, persistence, pricing/day options, admin display, and PHP migration runner.
### Phase 2: Registration Dictionary Phrases
Status: Complete
Completed: 2026-04-24
Plan count: 1/1
Goal: Move new and related registration phrases into the editable dictionary so public/admin registration wording can be managed from `/_rejestracja/Admin/Dictionary/Index`.
Planned:
- `02-01`: Complete - seeded dictionary phrases and updated registration templates to use translations.

View File

@@ -1,26 +1,45 @@
## Current Position
Milestone: v0.1 XXXV Konferencja Registration Update
Phase: 1 of 1 (Registration Form Update) - Complete
Plan: 01-01 complete
Phase: 2 of 2 (Registration Dictionary Phrases) - Complete
Plan: 02-01 complete
Status: UNIFY complete, loop closed
Last activity: 2026-04-24 - Created `.paul/phases/01-registration-form-update/01-01-SUMMARY.md`
Last activity: 2026-04-24 21:25:19 +02:00 - Created `.paul/phases/02-registration-dictionary-phrases/02-01-SUMMARY.md`
Progress:
- Milestone: [##########] 100%
- Phase 1: [##########] 100%
- Phase 2: [##########] 100%
## Loop Position
Current loop state:
```text
PLAN --> APPLY --> UNIFY
* * * [Loop complete - ready for next request]
* * * [Loop complete - milestone complete]
```
## Session Continuity
Last session: 2026-04-24
Stopped at: Plan 01-01 unified
Next action: Apply PHP migration on target server if not already applied, then deploy/test as needed
Resume file: `.paul/phases/01-registration-form-update/01-01-SUMMARY.md`
Last session: 2026-04-24 21:25:19 +02:00
Stopped at: Plan 02-01 unified
Next action: Apply dictionary seed on target server, then deploy/test as needed
Resume file: `.paul/phases/02-registration-dictionary-phrases/02-01-SUMMARY.md`
## Accumulated Context
### Decisions
| Decision | Phase | Impact |
|----------|-------|--------|
| 2026-04-24: Use stable `registration_*` dictionary keys for registration-specific phrases | Phase 2 | Admin can edit visible registration wording without template changes. |
| 2026-04-24: Preserve form values, persistence, pricing logic, and payment status values during dictionary refactor | Phase 2 | Registration behavior remains aligned with Phase 1. |
### Blockers/Concerns
- Production must run `_rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php?run=20260424` or apply the SQL file before dictionary entries are visible/editable.
### Deferred Issues
- None.
### Git State
Last commit: 96a1ac8
Branch: main
Feature branches merged: none.

View File

@@ -0,0 +1,20 @@
# 2026-04-24
## Co zrobiono
- [Phase 2, Plan 01] Przeniesiono nowe i powiązane frazy rejestracji do słownika.
- Dodano idempotentny SQL i runner PHP do seedowania wpisów `mf_dictionary`.
- Przepięto formularz publiczny, potwierdzenie oraz widoki admina rejestracji na `{translate}` / `|translate`.
- Zachowano dotychczasowe nazwy pól, wartości formularza, logikę ceny i zapis danych uczestnika.
## Zmienione pliki
- `_rejestracja/sql/2026-04-24-registration-dictionary-phrases.sql`
- `_rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php`
- `_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`
- `.paul/phases/02-registration-dictionary-phrases/02-01-PLAN.md`
- `.paul/phases/02-registration-dictionary-phrases/02-01-APPLY.md`
- `.paul/phases/02-registration-dictionary-phrases/02-01-SUMMARY.md`

View File

@@ -0,0 +1,46 @@
# APPLY Results: 02-01
Date: 2026-04-24 21:25:19 +02:00
## Completed Tasks
### Task 1: Seed dictionary entries for registration phrases
Status: pass
Notes:
- Added `_rejestracja/sql/2026-04-24-registration-dictionary-phrases.sql` with idempotent Polish `mf_dictionary` inserts.
- Added `_rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php` as a guarded browser/CLI seed runner.
- The PHP runner inserts missing phrases for existing dictionary languages; Polish gets the configured replacement, other languages get `lang_keyword` placeholders.
- Duplicate keyword check returned no duplicates.
### Task 2: Convert public registration form and confirmation output to dictionary phrases
Status: pass
Notes:
- Updated `_rejestracja/template/partial/Index/Index.tpl` so new invoice, referat/poster, fee, participation, day prompt, surcharge, diet, and price labels render through `{translate}`.
- Updated `_rejestracja/template/partial/Index/IndexSent.tpl` so confirmation labels, yes/no/default text, participation labels, diet labels, price labels, and consent labels use dictionary translations.
- Preserved form field names, radio values, hidden values, selected day values, and JavaScript pricing logic.
### Task 3: Convert admin registration list/detail display to dictionary phrases
Status: pass
Notes:
- Updated `_rejestracja/Admin/template/partial/Calc/Reg.tpl` to use dictionary translations for registration-related headers, labels, yes/no/default values, fee labels, consent labels, and edit/delete text.
- Updated `_rejestracja/Admin/template/partial/Calc/RegEdit.tpl` to use dictionary translations for the same registration detail/edit display values and payment status option labels.
- Preserved admin routes, form action, `payment_status` field name, and option values `1`/`2`.
## Verification
- `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 a non-visible HTML comment `<!-- Zgody -->` remains.
- Duplicate keyword scan in the PHP seed phrase list: pass
- Persistence/model/controller boundary check: pass; participant model and public controller files were not modified.
## Deviations
- Admin list/detail legacy fee text had old visible deadline years in templates. The dictionary-enabled display now uses the current `registration_fee_discount_2026` / `registration_fee_normal_2026` phrases while preserving the underlying condition and values.
- Unrelated working tree entries were present and left untouched: `_rejestracja/Static/image/Admin/Thumbs.db` and `.vscode/ftp-kr.sync.cache.json`.
## Next Step
Run `$paul-unify .paul/phases/02-registration-dictionary-phrases/02-01-PLAN.md` to reconcile the plan and close the loop.

View File

@@ -0,0 +1,170 @@
---
phase: 02-registration-dictionary-phrases
plan: 01
type: execute
wave: 1
depends_on: ["01-01"]
files_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
- _rejestracja/sql/2026-04-24-registration-dictionary-phrases.sql
- _rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php
autonomous: true
delegation: off
---
<objective>
## Goal
Add the registration phrases introduced or exposed by plan `01-01` to the site dictionary and update the registration/public/admin templates so those phrases render through `Dictionary::Translate`.
## Purpose
The client can manage conference wording from `/_rejestracja/Admin/Dictionary/Index` instead of requiring template edits for labels, option names, status values, and repeated summary text.
## Output
- Dictionary seed SQL and an idempotent PHP runner for the new phrase set.
- Public registration form labels/options changed to `{translate word=...}` / `|translate`.
- Confirmation and admin registration views changed to use dictionary translations for repeated labels, option labels, yes/no/default values, and participation/diet display values.
</objective>
<context>
## Project Context
@.paul/PROJECT.md
@.paul/ROADMAP.md
@.paul/STATE.md
## Prior Work
@.paul/phases/01-registration-form-update/01-01-SUMMARY.md
## Source Files
@_rejestracja/core/class/Dictionary.class.php
@_rejestracja/core/plugins/Smarty/function.translate.php
@_rejestracja/core/plugins/Smarty/modifier.translate.php
@_rejestracja/Admin/controller/DictionaryController.php
@_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
</context>
<acceptance_criteria>
## AC-1: Dictionary Contains Registration Phrase Set
```gherkin
Given the new dictionary seed runner has been executed
When an admin opens /_rejestracja/Admin/Dictionary/Index
Then the phrases introduced for the XXXV conference registration flow are listed as editable Polish dictionary entries
```
## AC-2: Public Form Uses Dictionary Phrases
```gherkin
Given the registration form is rendered
When the page displays invoice, talk/poster, participation, lodging, day choice, diet, and price labels
Then those visible strings are produced through the existing translation plugin instead of hard-coded template text
```
## AC-3: Confirmation And Admin Views Use Dictionary Phrases
```gherkin
Given a registration has been submitted
When the confirmation page/email and admin list/detail views render participant data
Then repeated labels, yes/no values, missing-value text, participation option labels, and diet labels come from the dictionary
```
## AC-4: Existing Registration Behavior Is Preserved
```gherkin
Given the phrase refactor is complete
When the modified PHP/Smarty templates are linted and searched
Then no database field mappings, pricing calculations, form field names, POST values, or payment status behavior have changed
```
</acceptance_criteria>
<tasks>
<task type="auto">
<name>Task 1: Seed dictionary entries for registration phrases</name>
<files>_rejestracja/sql/2026-04-24-registration-dictionary-phrases.sql, _rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php</files>
<action>
Create an idempotent dictionary seed for `mf_dictionary` covering phrases from the previous plan and additional related repeated phrases found during review:
- invoice/participant/institution/talk sections and field labels
- `Tak`, `Nie`, `brak`, payment status values
- fee labels, payment deadline labels for 03.10.2026, net/gross/VAT labels, total-to-pay labels
- participation labels: full conference, one day with lodging, one day without lodging, selected-day prompts, selected-day output labels
- lodging/accompanying-person labels and diet labels
- consent labels and admin action/status labels only where they are part of the registration views
Use stable keyword names for new implementation-focused phrases where the raw Polish phrase would be awkward or repeated with markup, for example `registration_participation_full`, `registration_yes`, `registration_no`, `registration_missing`, `registration_diet_standard`, `registration_fee_discount_2026`.
Preserve existing dictionary keys already used in templates (`agree1`, `agree2`, `agree_title`, `klauzula_ceny`, `send`, etc.) and do not duplicate them under new names unless a different visible phrase is needed.
The PHP runner must skip existing `(keyword, lang)` rows and create Polish replacements for at least `pl`; if the app exposes other langs through `Router::GetArrayLang()`, create placeholder replacements consistently with `Dictionary::CheckAndAdd`.
Avoid schema changes; this is data seeding only.
</action>
<verify>Run `php -l _rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php` and inspect the SQL/PHP phrase list for no duplicate keywords.</verify>
<done>AC-1 satisfied: seed files can populate all planned registration dictionary phrases without modifying schema.</done>
</task>
<task type="auto">
<name>Task 2: Convert public registration form and confirmation output to dictionary phrases</name>
<files>_rejestracja/template/partial/Index/Index.tpl, _rejestracja/template/partial/Index/IndexSent.tpl</files>
<action>
Replace hard-coded visible text introduced or touched by plan `01-01` with `{translate word='...'}` or `{'...'|translate}`:
- form headings and labels not already translated, especially invoice heading, referat/poster radio labels, fee option labels, participation options, selected-day prompt, lodging/accompanying-person labels, diet labels, `Jaka?`, and conference price label
- confirmation headings/labels and repeated values (`Tak`, `Nie`, `brak`, participation option labels, diet labels)
Keep technical values unchanged (`full`, `one_day_lodging`, `one_day_no_lodging`, `1`, `2`, posted field names, radio values, JavaScript IDs/classes).
For Smarty `replace` chains, translate replacement values with preassigned local variables if inline modifier expressions become hard to read.
Do not change pricing arithmetic, dates, selected-day values, or persisted participant fields in this task.
</action>
<verify>Search the two files for the target hard-coded Polish phrases and confirm remaining literals are dates, DB values, CSS/JS text, or legacy content intentionally out of scope.</verify>
<done>AC-2 and the public portion of AC-3 satisfied.</done>
</task>
<task type="auto">
<name>Task 3: Convert admin registration list/detail display to dictionary phrases</name>
<files>_rejestracja/Admin/template/partial/Calc/Reg.tpl, _rejestracja/Admin/template/partial/Calc/RegEdit.tpl</files>
<action>
Replace hard-coded registration-related labels and display values in the admin registration list and detail/edit views:
- participant, institution, talk/poster, amount/payment, consent, participation, diet, and payment status labels
- `Tak`, `Nie`, `brak`, participation option labels, `standardowa/specjalna`, edit/delete/cancel/save button text where these are in the registration views
Preserve admin routes, action names, form field names, payment status option values, delete confirmation behavior, and table/layout structure.
Do not refactor unrelated admin modules or compiled template cache.
</action>
<verify>Search the two admin templates for the target hard-coded registration phrases and confirm remaining literals are structural/admin legacy text outside this plan or values that must remain technical.</verify>
<done>Admin portion of AC-3 and AC-4 satisfied.</done>
</task>
</tasks>
<boundaries>
## DO NOT CHANGE
- `_rejestracja/controller/IndexController.php` form processing and persistence logic
- `_rejestracja/core/model/MfParticipant.class.php` and `_rejestracja/core/_model/MfParticipant.class.php`
- Existing pricing values, form field names, POST values, participant DB columns, and payment status values
- `_rejestracja/_Admin/temp/compile/*` and `_rejestracja/temp/compile/*`
- Third-party libraries and CKEditor assets
## SCOPE LIMITS
- This plan only dictionary-enables registration phrases from the recent registration update plus obvious repeated labels in the same registration views.
- Do not translate all legacy admin UI globally.
- Do not alter the admin dictionary UI itself beyond using it as the target for seeded phrases.
- Do not fix unrelated mojibake or old conference-year text unless it is directly in a phrase being moved to dictionary.
</boundaries>
<verification>
Before declaring plan complete:
- [ ] `php -l _rejestracja/sql/apply-2026-04-24-registration-dictionary-phrases.php`
- [ ] `rg -n "Dane do wystawienia faktury|Zgłaszam|Opłata obniżona|Biorę udział|Proszę zaznaczyć|Preferencje żywieniowe|Cena za konferencję|Typ udziału|Dopłata do pokoju|Osoba towarzysząca|dieta standardowa|dieta specjalna" _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`
- [ ] Review any remaining matches and document why they are intentionally left as literals
- [ ] Confirm no changed file in this plan modifies form names, radio values, price calculations, or participant persistence
</verification>
<success_criteria>
- New phrase seed is idempotent and ready for deployment.
- Registration phrases are visible/editable in the dictionary after seed execution or page render.
- Public form, confirmation output, admin list, and admin detail use dictionary translations for the targeted phrases.
- Existing registration behavior from phase 1 remains unchanged.
</success_criteria>
<output>
After completion, create `.paul/phases/02-registration-dictionary-phrases/02-01-SUMMARY.md`.
</output>

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*