meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| phplist4:core:translation [2026/09/30 09:25] – add docs tatevik | phplist4:core:translation [2026/09/30 09:32] (current) – fix style tatevik | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| **Translation** | **Translation** | ||
| | | ||
| - | | + | phpList core uses the Symfony Translation component. Translation strings are extracted from the code into XLIFF catalogs and loaded via Symfony' |
| | | ||
| - | | + | **Where translations live** |
| | | ||
| - | | + | Catalogs are stored in resources/ |
| | | ||
| - messages.en.xlf — application strings (log/ | - messages.en.xlf — application strings (log/ | ||
| Line 11: | Line 11: | ||
| - validators.en.xlf — Symfony Validator constraint messages | - validators.en.xlf — Symfony Validator constraint messages | ||
| | | ||
| - | | + | Only English (en) ships today. Adding a new language means messages.< |
| | | ||
| - | | + | **Adding new strings** |
| | | ||
| 1. Write the string literally inside a trans() call in code. | 1. Write the string literally inside a trans() call in code. | ||
| - | 2. Run the extractor to regenerate the catalog: | + | 2. Run the extractor to regenerate the catalog: php bin/console translation: |
| - | + | ||
| - | | + | |
| | | ||
| - | | + | This adds any new strings to messages.en.xlf. Translating to another locale means creating that locale' |
| | | ||
| - | **Translating via Weblate** | + | **Translating via Weblate** |
| | | ||
| - | | + | Translating strings by hand isn't required — this project is configured on Weblate. Translators can work in the Weblate UI, and Weblate opens merge requests back to the repository automatically with the updated XLIFF files. New/changed source strings in messages.en.xlf are picked up by Weblate for translation into other locales. |
| | | ||