91 lines
6.3 KiB
Markdown
91 lines
6.3 KiB
Markdown
# 2026-04-22
|
||
|
||
## Co zrobiono
|
||
|
||
- [Phase 15, Plan 01] Usunięcie Softra-insurance z modala rezerwacji — pozostają wyłącznie pakiety WP (SOFT/PREMIUM) z Phase 13
|
||
- Usunięty kontener `#carei-insurance-container` + wewnętrzny divider w szablonie widgetu Elementor
|
||
- Usunięta zmienna `insuranceContainer` (deklaracja + init) w `carei-reservation.js`
|
||
- Pozycje pricelist zawierające `ubezp|ochrony|zniesienie|insurance` są dropowane — nie trafiają do extras, podsumowania, ani do payloadu `makebooking`
|
||
|
||
- [Phase 16, Plan 01] i18n refactor pluginu carei-reservation — przygotowanie do dwujęzyczności PL/EN
|
||
- `load_plugin_textdomain('carei-reservation')` w bootstrapie + katalog `languages/`
|
||
- 8 plików PHP z user-facing stringami owiniętymi w `__()`/`esc_html__()`/`esc_attr__()`
|
||
- `carei-reservation.js`: ~70 literałów zamienione na wywołania `t()`/`tFmt()` przez globalny obiekt `window.careiI18n`, helper `pluralPl()` dla polskich form
|
||
- `wp_localize_script('carei-reservation-js', 'careiI18n', [...])` z 78 kluczami tłumaczonymi po PHP
|
||
- Wygenerowany `languages/carei-reservation.pot` — 157 unikalnych msgid gotowych do tłumaczenia (Phase 18)
|
||
- Admin panel: statyczna tablica statusów → helper `get_status_label()` (wymóg WP — translation timing)
|
||
- Mu-plugin `fix-sprintf-global.php` — backfill globalnego `window.sprintf` dla Automatic Translate Addon For Polylang
|
||
|
||
## Zmienione pliki
|
||
|
||
- `wp-content/plugins/carei-reservation/carei-reservation.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-elementor-widget.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-admin-panel.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-rest-proxy.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-search-widget.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-cities-widget.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-map-widget.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-branches-widget.php`
|
||
- `wp-content/plugins/carei-reservation/assets/js/carei-reservation.js`
|
||
- `wp-content/plugins/carei-reservation/languages/carei-reservation.pot` (nowy)
|
||
- `wp-content/mu-plugins/fix-sprintf-global.php` (nowy)
|
||
- `.paul/phases/15-remove-softra-insurance/15-01-PLAN.md`
|
||
- `.paul/phases/15-remove-softra-insurance/15-01-SUMMARY.md`
|
||
- `.paul/phases/16-i18n-plugin-refactor/16-01-PLAN.md`
|
||
- `.paul/phases/16-i18n-plugin-refactor/16-01-SUMMARY.md`
|
||
- `.paul/STATE.md`
|
||
- `.paul/ROADMAP.md`
|
||
|
||
## Phase 17 — Dwujęzyczne pakiety + mapowanie błędów Softra
|
||
|
||
- [Phase 17, Plan 01] Pola `name_en`/`description_en` w panelu pakietów SOFT/PREMIUM + sanitize/save
|
||
- REST `/protection-packages` z helperem `resolve_locale()` (`?lang=` → `determine_locale()` → fallback)
|
||
- `Carei_Softra_API::extract_softra_message()` — parser JSON odpowiedzi błędu
|
||
- `Carei_Softra_API::map_error_message()` — słownik 13 typowych PL komunikatów Softra → `__()` z textdomain, exact + fuzzy prefix match, graceful passthrough
|
||
- Frontend: `loadProtectionPackages()` dodaje `?lang=` na podstawie `document.documentElement.lang`
|
||
- Pliki: `class-admin-panel.php`, `class-rest-proxy.php`, `class-softra-api.php`, `carei-reservation.js`
|
||
- `.paul/phases/17-bilingual-packages-and-softra-errors/17-01-PLAN.md` + SUMMARY
|
||
|
||
## Phase 18 — EN translation .po/.mo + Flatpickr
|
||
|
||
- [Phase 18, Plan 01] Tłumaczenie EN pluginu carei-reservation — 158 wpisów z .pot przetłumaczone na angielski (branża car rental)
|
||
- Własny PHP kompilator `po2mo.php` (msgfmt niedostępny) — parsuje .po, sortuje, pakuje binarnie wg gettext spec (magic 0x950412de)
|
||
- Wygenerowane `carei-reservation-en_US.po` + `.mo` (9455 bytes, N=158) oraz `en_GB.po` + `.mo`
|
||
- **Scope addition:** Flatpickr 4.6.13 (CDN jsdelivr) — cross-browser date picker z locale PL/EN dla modal + hero; `static: true` dla modala (popup w container, bypass focus-trap); `disableMobile: true` dla spójności UX
|
||
- Kompaktowy CSS theme flatpickr w kolorach Carei (#2F2482): szerokość 260px, font 12–13px, zaokrąglone dni, miękki fioletowy shadow
|
||
- Graceful fallback — jeśli CDN padnie, wraca do natywnego `datetime-local` pickera
|
||
|
||
## Zmienione pliki (Phase 18)
|
||
|
||
- `wp-content/plugins/carei-reservation/carei-reservation.php` (Flatpickr enqueue)
|
||
- `wp-content/plugins/carei-reservation/assets/js/carei-reservation.js` (initDatePickers)
|
||
- `wp-content/plugins/carei-reservation/assets/css/carei-reservation.css` (kompaktowy theme)
|
||
- `wp-content/plugins/carei-reservation/languages/carei-reservation-en_US.po` (nowy)
|
||
- `wp-content/plugins/carei-reservation/languages/carei-reservation-en_US.mo` (nowy)
|
||
- `wp-content/plugins/carei-reservation/languages/carei-reservation-en_GB.po` (nowy)
|
||
- `wp-content/plugins/carei-reservation/languages/carei-reservation-en_GB.mo` (nowy)
|
||
- `.paul/phases/18-en-translation/18-01-PLAN.md` + SUMMARY
|
||
|
||
## Milestone v0.7 — Dwujęzyczność (PL/EN) ✅ COMPLETE
|
||
|
||
Plugin carei-reservation działa w pełni dwujęzycznie (PL + EN), z Flatpickr pokrywającym też kalendarze. Phase 16 (infrastruktura i18n) + Phase 17 (bilingual pakiety + Softra errors) + Phase 18 (tłumaczenia + UX).
|
||
|
||
## Phase 19 — Extras translations admin panel
|
||
|
||
- [Phase 19, Plan 01] Admin panel do zarządzania tłumaczeniami dynamicznych nazw extras z Softra API
|
||
- Nowe WP options: `carei_extras_seen` (auto-collected PL names), `carei_extras_translations` (admin override PL → EN)
|
||
- Helpery w `Carei_Admin_Panel`: `remember_extra_name()`, `get_extras_seen()`, `get_extras_translations()`, `translate_extra_name()`
|
||
- Submenu `wp-admin → Rezerwacje → Tłumaczenia extras` (lista PL + inputy EN + zapis z nonce/sanitize)
|
||
- `Carei_REST_Proxy::get_pricelist()` — runtime auto-collect + per-locale replacement nazw z fallbackiem do PL
|
||
- Reuse `resolve_locale()` z Phase 17 — brak duplikacji
|
||
|
||
## Zmienione pliki (Phase 19)
|
||
|
||
- `wp-content/plugins/carei-reservation/includes/class-admin-panel.php`
|
||
- `wp-content/plugins/carei-reservation/includes/class-rest-proxy.php`
|
||
- `.paul/phases/19-extras-translations-admin/19-01-PLAN.md` + SUMMARY
|
||
|
||
## Milestone v0.8 — Admin-managed tłumaczenia extras ✅ COMPLETE
|
||
|
||
System tłumaczeń pluginu kompletny: statyczne stringi (.po/.mo), bilingual pakiety + błędy Softra, dynamiczne extras z admin override. Użytkownik EN widzi całość w języku angielskim (poza świadomie pominiętymi danymi biznesowymi: nazwy miast/krajów/klas pojazdów).
|