129 lines
3.5 KiB
Markdown
129 lines
3.5 KiB
Markdown
---
|
|
phase: 11-translation-infrastructure
|
|
plan: 03
|
|
subsystem: i18n
|
|
tags: [translate, cli, csv, export, import, batch-translation]
|
|
|
|
dependency-graph:
|
|
requires:
|
|
- phase: 11-01
|
|
provides: [pl-locale, de-locale, translate-config]
|
|
provides:
|
|
- quotify:translate-export CLI command
|
|
- quotify:translate-import CLI command
|
|
- CSV-based translation workflow
|
|
affects: [11-04, 11-05, 11-06]
|
|
|
|
tech-stack:
|
|
added: []
|
|
patterns: [cli-export-command, cli-import-command, csv-translation-workflow]
|
|
|
|
key-files:
|
|
created:
|
|
- plugins/golem15/quotify/console/TranslateExportCommand.php
|
|
- plugins/golem15/quotify/console/TranslateImportCommand.php
|
|
modified:
|
|
- plugins/golem15/quotify/Plugin.php
|
|
|
|
key-decisions:
|
|
- "Use existing MessageExport column structure (code, x, locales)"
|
|
- "Default export path to storage/app/translations-export.csv"
|
|
- "Import preserves existing translations unless explicitly overwritten"
|
|
|
|
patterns-established:
|
|
- "Translation workflow: export CSV -> translate externally -> import CSV"
|
|
- "CLI commands registered via registerConsoleCommand in Plugin.php"
|
|
|
|
metrics:
|
|
duration: 2 min
|
|
completed: 2026-01-16
|
|
---
|
|
|
|
# Phase 11 Plan 03: Translation CLI Commands Summary
|
|
|
|
**CLI commands for bulk translation export/import using CSV format, enabling external translation workflows with Google Sheets or professional translators**
|
|
|
|
## Performance
|
|
|
|
- **Duration:** 2 min
|
|
- **Started:** 2026-01-16T12:06:45Z
|
|
- **Completed:** 2026-01-16T12:08:31Z
|
|
- **Tasks:** 3
|
|
- **Files modified:** 3
|
|
|
|
## Accomplishments
|
|
|
|
- Created `quotify:translate-export` command exporting 842 messages to CSV
|
|
- Created `quotify:translate-import` command for bulk import from CSV
|
|
- Commands registered and verified working with round-trip test
|
|
- CSV format includes code, default (original), en, pl, de columns
|
|
|
|
## Task Commits
|
|
|
|
Each task was committed atomically:
|
|
|
|
1. **Task 1: Create TranslateExportCommand** - `bb7959c` (feat)
|
|
2. **Task 2: Create TranslateImportCommand** - `690671d` (feat)
|
|
3. **Task 3: Register commands in Plugin.php** - `b154df6` (chore)
|
|
|
|
## Files Created/Modified
|
|
|
|
- `plugins/golem15/quotify/console/TranslateExportCommand.php` - Export all messages to CSV with locale columns
|
|
- `plugins/golem15/quotify/console/TranslateImportCommand.php` - Import translations from CSV, preserving existing
|
|
- `plugins/golem15/quotify/Plugin.php` - Register both commands in registerConsoleCommand calls
|
|
|
|
## Translation Workflow
|
|
|
|
```bash
|
|
# 1. Export all messages to CSV
|
|
php-legacy artisan quotify:translate-export
|
|
|
|
# 2. Edit storage/app/translations-export.csv in Google Sheets
|
|
# Add translations in pl and de columns
|
|
|
|
# 3. Import translated CSV
|
|
php-legacy artisan quotify:translate-import
|
|
|
|
# 4. Clear cache to see changes
|
|
php-legacy artisan cache:clear
|
|
```
|
|
|
|
## CSV Format
|
|
|
|
```csv
|
|
code,x,en,pl,de
|
|
cc367b544fab23df0ddaf982fb1445b5,"Skip to main content",,,
|
|
b1fdd5228710d4c6b6a7b5a95cb53eb3,"Team Inbox",,,
|
|
```
|
|
|
|
- `code` - MD5 hash identifier (matches Translate plugin)
|
|
- `x` - Original English string (default)
|
|
- `en`, `pl`, `de` - Locale translation columns
|
|
|
|
## Decisions Made
|
|
|
|
None - followed plan as specified.
|
|
|
|
## Deviations from Plan
|
|
|
|
None - plan executed exactly as written.
|
|
|
|
## Issues Encountered
|
|
|
|
None.
|
|
|
|
## User Setup Required
|
|
|
|
None - no external service configuration required.
|
|
|
|
## Next Phase Readiness
|
|
|
|
Phase 11 Plan 04 (Plugin Translations) can proceed:
|
|
- CLI workflow ready for bulk translation management
|
|
- 842 theme messages available for export
|
|
- Import preserves existing translations for incremental updates
|
|
|
|
---
|
|
*Phase: 11-translation-infrastructure*
|
|
*Completed: 2026-01-16*
|