.php.
Source file
Save this example aslocales/en-US/messages.php.
Configure your files
Use thisi18n.yml for the example, or add its file mapping to your existing bucket.
See path templates for other layouts.
Translate
Install the CLI and setOPENAI_API_KEY in your
project’s .env.local or shell. You can also configure another
AI provider.
Behavior and limitations
-
Files must start with
<?phpand return one static[...]orarray(...)literal. - Use quoted keys and string values. Nested arrays become dotted keys.
- Comments, ordering, whitespace, quote style, and array syntax are preserved by replacing existing value literals.
-
Variables, function calls, constants,
declare(...), and interpolated double-quoted strings are rejected.
Next steps
- Check translations before committing generated files.
- Local translation workflow explains repeat runs.
- Browse all file formats.

