WinterCMS research
This commit is contained in:
161
docs/research/wintercms/quotifypro-11-i18n/11-01-PLAN.md
Normal file
161
docs/research/wintercms/quotifypro-11-i18n/11-01-PLAN.md
Normal file
@@ -0,0 +1,161 @@
|
||||
---
|
||||
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"
|
||||
---
|
||||
|
||||
<objective>
|
||||
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.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<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
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Create locale seeder migration</name>
|
||||
<files>plugins/golem15/translate/updates/v2.4.0/seed_quotify_locales.php, plugins/golem15/translate/updates/version.yaml</files>
|
||||
<action>
|
||||
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.
|
||||
</action>
|
||||
<verify>php-legacy artisan winter:up runs without errors</verify>
|
||||
<done>Migration runs successfully, PL and DE locales exist in database</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Create Translate plugin configuration</name>
|
||||
<files>config/golem15/translate/config.php</files>
|
||||
<action>
|
||||
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.
|
||||
</action>
|
||||
<verify>File exists and is valid PHP syntax: php-legacy -l config/golem15/translate/config.php</verify>
|
||||
<done>Config file created with appropriate defaults</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 3: Run migration and verify locales</name>
|
||||
<files>None (database operation)</files>
|
||||
<action>
|
||||
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']
|
||||
</action>
|
||||
<verify>Tinker output shows all 3 locales</verify>
|
||||
<done>EN, PL, DE locales all present and enabled in database</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
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
|
||||
</verification>
|
||||
|
||||
<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>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/11-translation-infrastructure/11-01-SUMMARY.md`
|
||||
</output>
|
||||
Reference in New Issue
Block a user