3.9 KiB
phase, plan, subsystem, tags, depends_on, tech-stack, key-files, decisions, metrics
| phase | plan | subsystem | tags | depends_on | tech-stack | key-files | decisions | metrics | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 16-content-localization | 01 | translation |
|
|
|
|
|
|
Phase 16 Plan 01: Trade Category Translations Summary
TranslatableModel behavior added to TradeCategory with Polish and German translations seeded for all 36 categories.
What Was Done
Task 1: Add TranslatableModel behavior to TradeCategory
Added the Golem15.Translate.Behaviors.TranslatableModel behavior to the TradeCategory model with soft dependency prefix (@). Marked name and description as translatable fields.
Key changes:
- Added
$implementarray with TranslatableModel behavior - Added
$translatable = ['name', 'description']property
Task 2: Seed Polish and German translations
Created migration v1.4.0/add_trade_category_translations.php that seeds translations for all trade categories.
Categories translated (36 total):
| Main Category | Polish | German |
|---|---|---|
| Plumbing | Hydraulika | Sanitaer- und Heizungstechnik |
| Electrical | Elektryka | Elektrik |
| Painting & Decorating | Malowanie i dekoracja | Malerarbeiten |
| Carpentry | Stolarstwo | Tischlerei |
| Roofing | Dekarstwo | Dachdeckerei |
| Masonry | Murarstwo | Maurerarbeiten |
| HVAC | Klimatyzacja i wentylacja | Heizung, Lueftung, Klimatechnik |
| Landscaping | Architektura krajobrazu | Garten- und Landschaftsbau |
| General Repairs | Naprawy ogolne | Allgemeine Reparaturen |
Plus 27 subcategories with appropriate translations.
Decisions Made
-
Soft dependency for TranslatableModel: Using
@prefix allows TradeCategory to work even if Translate plugin is not installed. -
36 categories, not 33: Actual database has 9 main categories with 3 subcategories each = 36 total (not 33 as estimated in plan).
-
DB::table() pattern: Consistent with project decision 11-01, using raw DB queries in seeder to avoid model boot issues during migration.
Verification Results
// Polish translation
$translator->setLocale('pl');
$cat = TradeCategory::where('slug', 'plumbing')->first();
$cat->name; // "Hydraulika"
// German translation
$translator->setLocale('de');
$cat->name; // "Sanitaer- und Heizungstechnik"
// English (default)
$translator->setLocale('en');
$cat->name; // "Plumbing"
Deviations from Plan
None - plan executed exactly as written.
Commits
| Hash | Message |
|---|---|
| b9765b4 | feat(16-01): add TranslatableModel behavior to TradeCategory |
| 1d65bed | feat(16-01): seed Polish and German translations for trade categories |
| 9984eae | chore(16-01): update quotify submodule for trade category translations |
Files Changed
Created:
plugins/golem15/quotify/updates/v1.4.0/add_trade_category_translations.php
Modified:
plugins/golem15/quotify/models/TradeCategory.phpplugins/golem15/quotify/updates/version.yaml
Next Phase Readiness
Phase 16-01 complete. Ready for 16-02 (Service Area translations) or other content localization tasks.
Prerequisites delivered:
- TradeCategory model is translatable
- Polish and German translations seeded
- Pattern established for other models needing translation