--- phase: 11-translation-infrastructure plan: 01 type: execute wave: 1 depends_on: [] files_modified: - plugins/golem15/translate/updates/version.yaml - plugins/golem15/translate/updates/v2.4.0/seed_quotify_locales.php - config/golem15/translate/config.php autonomous: true must_haves: truths: - "Polish locale (pl) is enabled and available" - "German locale (de) is enabled and available" - "English remains the default locale" - "translate:scan command extracts theme messages to database" - "Messages backend shows scanned translation strings" artifacts: - path: "plugins/golem15/translate/updates/v2.4.0/seed_quotify_locales.php" provides: "Migration to seed PL and DE locales" - path: "config/golem15/translate/config.php" provides: "Translate plugin configuration" key_links: - from: "seed_quotify_locales.php" to: "winter_translate_locales table" via: "database seeder" pattern: "DB::table.*locales.*insert" --- Configure translation infrastructure with Polish and German locales. Purpose: Establish the locale configuration and verify the Translate plugin workflow works correctly for scanning, storing, and managing translatable strings. Output: Working translation infrastructure with EN (default), PL, and DE locales configured. @~/.claude/get-shit-done/workflows/execute-plan.md @~/.claude/get-shit-done/templates/summary.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md # Translate plugin understanding @plugins/golem15/translate/Plugin.php @plugins/golem15/translate/models/Locale.php @plugins/golem15/translate/models/Message.php @plugins/golem15/translate/classes/ThemeScanner.php Task 1: Create locale seeder migration plugins/golem15/translate/updates/v2.4.0/seed_quotify_locales.php, plugins/golem15/translate/updates/version.yaml Create a new migration that seeds Polish and German locales: 1. Create directory `plugins/golem15/translate/updates/v2.4.0/` 2. Create `seed_quotify_locales.php` migration: - Insert Polish locale: code='pl', name='Polski', is_enabled=1, is_default=0, sort_order=2 - Insert German locale: code='de', name='Deutsch', is_enabled=1, is_default=0, sort_order=3 - Use DB::table() for direct insertion (not model to avoid boot issues) - Make migration idempotent (check if locale exists before inserting) 3. Update version.yaml to add: ```yaml "2.4.0": - Add Polish and German locales for Quotify.pro - v2.4.0/seed_quotify_locales.php ``` Note: English (en) locale already exists as default from existing seed data. php-legacy artisan winter:up runs without errors Migration runs successfully, PL and DE locales exist in database Task 2: Create Translate plugin configuration config/golem15/translate/config.php Create Translate plugin config file to configure caching and behavior: 1. Create directory `config/golem15/translate/` if not exists 2. Create `config.php` with: ```php 1440, /* * When enabled, the locale prefix will be added to URLs * for the default locale as well (e.g., /en/about instead of /about). * Default: false - default locale has no prefix */ 'prefixDefaultLocale' => false, /* * Disable locale prefix routing entirely. * When true, locales are managed via session/cookie only. * Default: false */ 'disableLocalePrefixRoutes' => false, ]; ``` This allows customization later without modifying plugin code. File exists and is valid PHP syntax: php-legacy -l config/golem15/translate/config.php Config file created with appropriate defaults Task 3: Run migration and verify locales None (database operation) 1. Run migrations: `php-legacy artisan winter:up` 2. Clear cache: `php-legacy artisan cache:clear` 3. Verify locales exist by running tinker check: ```bash php-legacy artisan tinker --execute="print_r(\Golem15\Translate\Models\Locale::all()->pluck('name', 'code')->toArray())" ``` Expected output: ['en' => 'English', 'pl' => 'Polski', 'de' => 'Deutsch'] Tinker output shows all 3 locales EN, PL, DE locales all present and enabled in database Before declaring plan complete: - [ ] `php-legacy artisan winter:up` succeeds - [ ] 3 locales exist: en (default), pl, de - [ ] All locales are enabled - [ ] Config file exists at config/golem15/translate/config.php - All tasks completed - Polish and German locales added to database - English remains default locale - Translate plugin config file exists - No errors during migration After completion, create `.planning/phases/11-translation-infrastructure/11-01-SUMMARY.md`