Files
summer-phrasebook/docs/research/wintercms/quotifypro-11-i18n/11-01-PLAN.md
2026-02-18 01:31:41 +01:00

5.4 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
phase plan type wave depends_on files_modified autonomous must_haves
11-translation-infrastructure 01 execute 1
plugins/golem15/translate/updates/version.yaml
plugins/golem15/translate/updates/v2.4.0/seed_quotify_locales.php
config/golem15/translate/config.php
true
truths artifacts key_links
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
path provides
plugins/golem15/translate/updates/v2.4.0/seed_quotify_locales.php Migration to seed PL and DE locales
path provides
config/golem15/translate/config.php Translate plugin configuration
from to via pattern
seed_quotify_locales.php winter_translate_locales table database seeder 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.

<execution_context> @/.claude/get-shit-done/workflows/execute-plan.md @/.claude/get-shit-done/templates/summary.md </execution_context>

@.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
   <?php

   return [
       /*
        * Cache timeout in minutes for translated messages.
        * Default: 1440 (24 hours)
        */
       'cacheTimeout' => 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

<success_criteria>

  • All tasks completed
  • Polish and German locales added to database
  • English remains default locale
  • Translate plugin config file exists
  • No errors during migration </success_criteria>
After completion, create `.planning/phases/11-translation-infrastructure/11-01-SUMMARY.md`