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:
@@ -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.
|
||||
170
.paul/phases/02-registration-dictionary-phrases/02-01-PLAN.md
Normal file
170
.paul/phases/02-registration-dictionary-phrases/02-01-PLAN.md
Normal 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>
|
||||
124
.paul/phases/02-registration-dictionary-phrases/02-01-SUMMARY.md
Normal file
124
.paul/phases/02-registration-dictionary-phrases/02-01-SUMMARY.md
Normal 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*
|
||||
Reference in New Issue
Block a user