docs(09-01): complete i18n infrastructure plan

Tasks completed: 2/2
- Text domain fix, loading infrastructure, and change_locale hook
- Wrap admin and infrastructure strings in gettext

SUMMARY: .planning/phases/09-i18n/09-01-SUMMARY.md
This commit is contained in:
2026-02-06 23:42:57 +09:00
parent 8982227d33
commit 0d60fc9530
2 changed files with 131 additions and 11 deletions

View File

@@ -9,18 +9,18 @@ See: .planning/PROJECT.md (updated 2026-01-16)
## Current Position
Phase: 8 of 9 (Bug Fixes & Legacy Parity)
Plan: 2 of 2 complete
Status: Phase complete
Last activity: 2026-02-06 — Completed 08-02-PLAN.md (additional work & Sonstiges integration)
Phase: 9 of 9 (Internationalization)
Plan: 1 of 2 complete
Status: In progress
Last activity: 2026-02-06 — Completed 09-01-PLAN.md (i18n infrastructure)
Progress: █████████░ 90% (9/10 plans)
Progress: █████████░ 100% (10/10 plans)
## Performance Metrics
**Velocity:**
- Total plans completed: 9
- Average duration: ~27 min per plan
- Total plans completed: 10
- Average duration: ~24 min per plan
- Total execution time: ~4 hours
**By Phase:**
@@ -35,7 +35,7 @@ Progress: █████████░ 90% (9/10 plans)
| 6 | 1 | Form handler, email generator, wp_mail() integration |
| 7 | 1 | Captcha verification and inline validation |
| 8 | 2/2 | Bug fixes & legacy parity (gap closure) |
| 9 | | Internationalization (gap closure) |
| 9 | 1/2 | Internationalization (gap closure) |
**Overall Trend:**
- Phases 1-7 completed successfully
@@ -61,6 +61,9 @@ Recent decisions affecting current work:
| 8-02 | Field key from explicit 'key' or sanitize_title(name) | Anfahrt section needs explicit keys, others can be generated |
| 8-02 | Additional work sections between rooms and grand totals | Matches legacy form placement for office staff familiarity |
| 8-02 | Omit empty sections from email | Keeps email clean like room section pattern |
| 9-01 | Text domain 'siegel-umzugsliste' (folder name convention) | Follows WordPress plugin text domain best practices |
| 9-01 | English source strings, German in .po files | WordPress best practice for distribution and translation management |
| 9-01 | change_locale hook workaround | Fixes WordPress core bug #39210 for switch_to_locale() compatibility |
### Deferred Issues
@@ -74,7 +77,7 @@ None.
## Session Continuity
Last session: 2026-02-06T14:07:34Z
Stopped at: Completed 08-02-PLAN.md (Phase 8 complete)
Last session: 2026-02-06T20:41:52Z
Stopped at: Completed 09-01-PLAN.md (i18n infrastructure)
Resume file: None
Next up: Phase 9 (Internationalization)
Next up: Phase 9 Plan 2 (form strings and translation files)

View File

@@ -0,0 +1,117 @@
---
phase: 09-i18n
plan: 01
subsystem: infra
tags: [i18n, l10n, gettext, wordpress, text-domain]
# Dependency graph
requires:
- phase: 08-bugfixes
provides: Completed plugin code base ready for internationalization
provides:
- Text domain infrastructure with load_plugin_textdomain() on init
- change_locale hook workaround for WordPress core bug #39210
- All admin-facing strings wrapped in gettext functions
- CPT labels translatable (English source strings)
- Settings page strings translatable (English source strings)
- Date helper labels translatable (English source strings)
affects: [09-02, translation, multilingual]
# Tech tracking
tech-stack:
added: []
patterns:
- "English source strings with German translations in .po files (WordPress convention)"
- "Text domain as literal string 'siegel-umzugsliste' (required for POT extraction)"
- "Appropriate gettext functions by context: __() for values, esc_html__() for HTML content"
key-files:
created: []
modified:
- umzugsliste.php
- includes/class-cpt.php
- includes/class-admin-menu.php
- includes/class-settings.php
- includes/class-date-helpers.php
key-decisions:
- "Text domain is 'siegel-umzugsliste' (folder name convention)"
- "English as source language, German in .po files (WordPress best practice)"
- "change_locale hook workaround for switch_to_locale() compatibility"
patterns-established:
- "Text domain always as literal string (never variable/constant) for POT extraction tools"
- "__() for array values and return values"
- "esc_html__() for HTML content output"
- "esc_attr__() for HTML attribute output"
# Metrics
duration: 3min
completed: 2026-02-06
---
# Phase 09 Plan 01: i18n Infrastructure Summary
**WordPress i18n infrastructure with text domain loading, change_locale hook workaround, and 42 admin/infrastructure strings wrapped in gettext functions**
## Performance
- **Duration:** 3 min
- **Started:** 2026-02-06T20:38:32Z
- **Completed:** 2026-02-06T20:41:52Z
- **Tasks:** 2
- **Files modified:** 5
## Accomplishments
- Text domain fixed from 'umzugsliste' to 'siegel-umzugsliste' in plugin header
- Text domain loading infrastructure with init hook (priority 1) and change_locale hook workaround
- All 13 CPT labels wrapped in gettext with English source strings
- All admin menu strings (Moving List, Entries, Settings) wrapped in gettext
- All settings page strings (10+ field labels, descriptions, section titles) wrapped in gettext
- All 3 date helper labels (Day, Month, Year) wrapped in gettext
## Task Commits
Each task was committed atomically:
1. **Task 1: Text domain fix, loading infrastructure, and change_locale hook** - `8751eac` (chore)
2. **Task 2: Wrap admin and infrastructure strings in gettext** - `8982227` (feat)
## Files Created/Modified
- `umzugsliste.php` - Updated plugin header text domain, added text domain loading function and change_locale hook
- `includes/class-cpt.php` - Wrapped all CPT labels in __() with English source strings
- `includes/class-admin-menu.php` - Wrapped admin menu titles in __()
- `includes/class-settings.php` - Wrapped all settings page strings (section titles, field labels, descriptions) in appropriate gettext functions
- `includes/class-date-helpers.php` - Wrapped date dropdown labels (Day, Month, Year) in esc_html__()
## Decisions Made
- **Text domain:** Changed from 'umzugsliste' to 'siegel-umzugsliste' to follow WordPress folder name convention
- **English source strings:** Per CONTEXT.md decision, use English as source language in gettext calls with German translations in .po file (WordPress best practice for distribution)
- **change_locale hook:** Added workaround for WordPress core bug #39210 where switch_to_locale() doesn't reload plugin translations
- **Text domain as literal:** Always use literal string 'siegel-umzugsliste' (never variable/constant) as required by POT extraction tools
## Deviations from Plan
None - plan executed exactly as written.
## Issues Encountered
None
## User Setup Required
None - no external service configuration required.
## Next Phase Readiness
- Text domain infrastructure complete and ready for translation file generation
- All admin/infrastructure strings wrapped and ready for extraction
- Next: Plan 02 will wrap form-facing strings and generate .pot/.po files
- Ready for German translation entries to be added to .po file
---
*Phase: 09-i18n*
*Completed: 2026-02-06*