.po catalogs inside your package, and Aikeedo merges them into the dictionary for every request.
Wrap your strings
The functions are global, so they work in PHP, and they’re registered as Twig functions and filters too.__() helper is available on pages that load Aikeedo’s bundles.
Catalog layout
- One directory per locale, named with the
xx-XXcode Aikeedo uses. - The file is always
messages.po. - Set the
X-Domainheader tomessages, so your strings merge into the default dictionary and plain__()calls resolve. Without that header the catalog is loaded under theplugindomain, and your__()calls won’t find their translations.
locale/de-DE/LC_MESSAGES/messages.po
Aikeedo loads catalogs for every installed plugin, active or not, for the language it resolved for the request.
Extract strings
Run the console command from the installation root, and point it at your package:.twig, .php and .js files, creates or updates the catalogs, removes entries that no longer exist in the source, and rebuilds the browser catalogs.
Developing outside the installation directory works the same way:
Translate
Aikeedo can machine-translate the missing entries with a model:
Review machine translations before release, especially short UI strings where context matters.
Rebuild browser catalogs
Strings used from JavaScript are compiled into per-language files served to the browser:Ship the catalogs
Include thelocale/ directory in your release archive. Nothing generates translations at install time, so a package without catalogs shows English to everyone.
Checklist
Every user-visible string goes through
__(), p__() or n__().Navigation labels use the
nav context.Catalogs live at
locale/{code}/LC_MESSAGES/messages.po.Every catalog sets
X-Domain: messages.You re-ran extraction after the last wording change.
The
locale/ directory is in your release archive.