| name | translations |
| description | Update Laravel PHP translation files by fixing missing or empty translations in lang/**/*.php. Use when UI copy changes, new keys are added, or locale files are out of sync. Trigger whenever translation keys, lang files, i18n, or __() / @lang() strings are mentioned. |
Translations Updater
This skill keeps Laravel translation files consistent and complete.
Key conventions
This project uses translations keys in JSON files.
When to use this Skill
- New UI text or translation keys were introduced
- Modules, pages, or components added new strings
- PHP translation files contain empty or missing values
- Locale files are out of sync with the codebase
- A supported language is added or removed
Voice and tense per locale for logs
When we are translating logs, match the convention for each language:
| Locale | Convention | Example |
|---|
en | Simple past, active | "Created an account" |
fr_FR | Passé composé, actif | "A créé un compte" |
de | Perfekt, active (Hat + Partizip) | "Hat ein Konto erstellt" |
Instructions
Step 1: Regenerate locale files
- Run the locale generation command:
composer beaver:locale
- Confirm the command completes successfully before making any edits.
Step 2: Identify missing or empty translations
- For each new entry in the
en.json file, check all other locale files of the project and fix any missing or empty translations.
- Do not remove keys unless they are confirmed unused.
- For empty or invalid values — replace with an appropriate human-readable translation.
- Preserve placeholders exactly — do not alter tokens like
:name, :count, :seconds, {value}.
- Preserve embedded HTML or Markdown — structure must be identical across locales.
- Consistency rules:
- Same tense and tone as surrounding keys
- Same terminology used elsewhere in the locale file
- No informal register unless the file already uses it
Step 3: Quality checks
- No empty strings, null values, or
TODO placeholders remain.
- If a translation is uncertain, prefer literal and conservative wording.
- Maintain existing key order unless the project explicitly requires sorting.
- Run
bash scripts/check-translations.sh after translation changes; it checks all PHP short-key language files and fails on empty strings.