tailrdigital/sulu-translations-bundle
A Sulu CMS bundle from Tailr Digital that simplifies managing translations and multilingual content, helping organize translation files and localization workflows in Sulu-based websites.
This is a Sulu CMS bundle (Symfony-based), not a Laravel package — there is no service provider or config/app.php entry. If you're a Laravel developer, map your instincts as follows: composer require → config/bundles.php, .env → config/packages/*.yaml, php artisan migrate → bin/console doctrine:migrations:migrate, php artisan cache:clear → bin/console cache:clear.
Minimal steps:
composer require tailrdigital/sulu-translations-bundleTailr\SuluTranslationsBundle\SuluTranslationsBundle in config/bundles.php (after SuluBundle).config/routes/sulu_admin.yaml and config/packages/sulu_admin.yaml as instructed by the bundle README.bin/console cache:clear and rebuild the admin UI (bin/console sulu:admin:update-build or your usual asset build)./admin → Settings → Translations.Look first at src/Resources/config/ (services, Doctrine mapping) and the entity/repository pair — that tells you the storage model, which is what everything else hinges on. Your first real use case: replace a hardcoded messages.en.yaml key with a DB-backed translation key, render it in Twig ({{ 'my.key'|trans }}), and confirm it resolves per locale.
Admin-driven translation workflow. Translation keys are created and edited in the Sulu admin rather than in XLIFF/YAML files. The typical team pattern: developers create keys + English source text, translators fill the rest in the admin, and no deploy is needed to ship copy changes.
Consuming keys in templates. Keep using Symfony's translator in Twig/PHP — the bundle supplies the values. Verify the domain/loader ordering in config/packages/translation.yaml so DB-backed keys take precedence over (or fall back to) file-based ones in the same domain.
AI translation (new in 0.4.0). The release activates Sulu's AI translation feature for translation keys. Pattern:
.env, provider config in config/packages/sulu_ai.yaml) — without a working provider the action is unavailable, not merely broken.Seeding / fixtures. For reproducible environments, create translation keys programmatically via the bundle's repository or a Doctrine fixture rather than clicking through the admin. Pair this with your normal doctrine:fixtures:load step in CI and local bootstrap.
Importing existing copy. If you're migrating from file-based translations, script the import (parse YAML/XLIFF → insert keys) and keep the source files in VCS until you've confirmed parity. This makes rollback trivial.
Permission-aware integration. Translation keys live behind Sulu security contexts. Grant view/edit contexts to the translator role; the AI action respects the same edit permission, so a role without it won't see the button — a common "the feature is missing" false alarm.
composer.json and read the changelog before every upgrade; 0.4.0 itself looks additive, but the pattern is worth internalising.config:dump-reference sulu_translations (or the bundle's config tree) is your friend for discovering options.sulu_ai/translation config first before filing a bug.bin/console cache:clear, and your HTTP/production cache layer) or you'll chase phantom stale strings.bin/console debug:container | grep -i transl to find the bundle's services. For AI calls, log the HTTP client traffic.config/services.yaml to add validation or audit-logging around translation saves rather than forking the bundle.How can I help you explore Laravel packages today?