Files
2026-02-18 01:31:41 +01:00

6.2 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 02 execute 2
11-01
themes/quotify/config/translate.yaml
true
truths artifacts key_links
translate:scan extracts theme strings to database
Messages backend page shows extracted strings
Theme has translate.yaml config for organized translation management
path provides
themes/quotify/config/translate.yaml Theme translation configuration file
from to via
translate:scan winter_translate_messages table ThemeScanner::scanForMessages()
Scan theme templates and set up translation workflow.

Purpose: Extract all translatable strings from the Quotify theme into the database for translation management, and create the theme's translation config file. Output: All theme strings scanned into database, translate.yaml config in place.

<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

Prior plan

@.planning/phases/11-translation-infrastructure/11-01-SUMMARY.md

Translation scanner

@plugins/golem15/translate/classes/ThemeScanner.php @plugins/golem15/translate/console/ScanCommand.php

Task 1: Create theme translate.yaml configuration themes/quotify/config/translate.yaml Create the theme's translation configuration file for organized translation management. This file allows defining translations directly in the theme config (alternative to database management).
Create `themes/quotify/config/translate.yaml`:
```yaml
# Quotify Theme Translation Configuration
# This file can contain static translations or reference YAML files per locale.
# The translate:scan command will import these into the database.
#
# Structure options:
# 1. Inline translations:
#    en:
#      'Hello': 'Hello'
#    pl:
#      'Hello': 'Cześć'
#
# 2. Reference YAML files:
#    en: en.yaml
#    pl: pl.yaml
#
# For now, we rely on database-based translation management via backend.
# This file serves as documentation and can be extended later for static translations.

# Placeholder for future static translations
# Translations are managed via Backend > Settings > Translation Messages
```

Note: The translate.yaml file is optional but good practice. The primary workflow uses:
1. `translate:scan` to extract strings from theme templates
2. Backend Messages interface to add translations
3. Export/Import for bulk translation management
File exists at themes/quotify/config/translate.yaml Theme translation config file created Task 2: Run theme translation scan None (database operation) Run the translation scanner to extract all translatable strings from the theme:
1. First, run with purge to start fresh:
   ```bash
   php-legacy artisan translate:scan --purge
   ```
   This will:
   - Truncate existing messages (fresh start for Quotify)
   - Scan all theme layouts, pages, partials
   - Scan all plugin component templates
   - Scan all mail templates
   - Import found strings into winter_translate_messages table

2. Clear cache after scan:
   ```bash
   php-legacy artisan cache:clear
   ```

3. Verify scan results by checking message count:
   ```bash
   php-legacy artisan tinker --execute="echo \Golem15\Translate\Models\Message::count() . ' messages scanned'"
   ```
   Expected: Several hundred messages (theme has ~3600+ translation filter usages, but many are duplicates)
Message count is > 100 (theme has substantial content) Theme strings successfully scanned into database Task 3: Verify translation workflow end-to-end None (verification only) Verify the complete translation workflow is operational:
1. Check a sample message exists and has correct structure:
   ```bash
   php-legacy artisan tinker --execute="
   \$msg = \Golem15\Translate\Models\Message::first();
   echo 'Code: ' . \$msg->code . PHP_EOL;
   echo 'Data: ' . json_encode(\$msg->message_data) . PHP_EOL;
   "
   ```

2. Check locales are available for selection:
   ```bash
   php-legacy artisan tinker --execute="
   print_r(\Golem15\Translate\Models\Locale::listEnabled());
   "
   ```
   Expected: ['en' => 'English', 'pl' => 'Polski', 'de' => 'Deutsch']

3. Verify export columns include all locales:
   ```bash
   php-legacy artisan tinker --execute="
   print_r(\Golem15\Translate\Models\MessageExport::getColumns());
   "
   ```
   Expected: ['code' => 'code', 'x' => 'default', 'en' => 'en', 'pl' => 'pl', 'de' => 'de']

4. Test Message::trans() works:
   ```bash
   php-legacy artisan tinker --execute="
   \Golem15\Translate\Models\Message::\$locale = 'en';
   echo \Golem15\Translate\Models\Message::trans('Home');
   "
   ```
   Should return 'Home' (or the translated value if exists)
All tinker checks pass without errors Translation workflow verified end-to-end Before declaring plan complete: - [ ] themes/quotify/config/translate.yaml exists - [ ] translate:scan completed successfully - [ ] Messages table has 100+ entries - [ ] Locale::listEnabled() returns all 3 locales - [ ] MessageExport::getColumns() includes en, pl, de columns - [ ] Message::trans() returns translated content

<success_criteria>

  • All tasks completed
  • Theme translation config file created
  • Theme strings scanned into database
  • Translation workflow verified working
  • All locales available for translation </success_criteria>
After completion, create `.planning/phases/11-translation-infrastructure/11-02-SUMMARY.md`