Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Admin Translatable Bundle Laravel Package

fsi/admin-translatable-bundle

Symfony bundle for managing translations in admin interfaces. It adds translatable admin resources so editors can maintain multilingual content and labels from one backend, simplifying locale-aware workflows and keeping translations close to the admin experience.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Symfony bundle, not a Laravel package — there is no service provider, no config/admin-translatable.php, and nothing auto-discovered by Composer. Realistically, a Laravel developer will mine it for the pattern (per-locale form tabs + locale-aware datagrid + admin locale switcher) rather than install it. The nearest Laravel equivalents are astrotomic/laravel-translatable (translations table) plus a Filament/Nova resource that renders one tab per locale.

If you do need to run it (legacy Symfony project):

  1. composer require fsi/admin-translatable-bundle — it pulls in fsi/admin-bundle and fsi/translatable-bundle; it does nothing on its own.
  2. Register FSi\Bundle\AdminTranslatableBundle\FSiAdminTranslatableBundle in config/bundles.php and import the bundle's routing for the locale switch endpoint.
  3. Add config for the available locales and the default locale, then expose the locale-switch control in your admin layout.
  4. Mark your Doctrine entity with the translatable contract from fsi/translatable-bundle (a translations OneToMany + TranslatableTrait) and make your admin class translatable-aware.

Where to look first: the README's "usage" section, then FSi\Bundle\AdminTranslatableBundle\Manager\LocaleManager (how the active locale is resolved and stored) and the form type that renders locale tabs. That form type is the piece worth copying into a Laravel implementation.

First use case: take an existing admin CRUD for an entity like Article, add a translations relation, and register it as translatable so the edit form gains one tab per locale and the list view gains a locale column/filter.

Implementation Patterns

  • Locale switcher as ambient state. The bundle stores the current admin locale (session/cookie) and a request listener resolves it for every admin request. In Laravel terms this is App::setLocale() driven by a middleware reading session('admin_locale'). Keep the resolution in one place — a LocaleManager-style singleton — so forms, grids, and queries agree.
  • One form per locale, tabbed UI. Each locale gets its own translated-field set; the parent (non-translated) fields sit outside the tabs. On submit, persist all locale translations, not just the active tab — the active tab is a UI concept, not a save scope.
  • Translation-aware datagrid. The datagrid extension joins translations filtered by the active locale and adds a locale column + filter. The Laravel analogue is a query scope: ->withTranslation($locale) plus a locale filter on the table resource.
  • Fallback strategy. Reads fall back to the default locale when the active locale has no translation; writes never fall back. Encode this in the entity accessor ($article->translate($locale)->getTitle() ?? $article->getTitle()), not in the controller.
  • Admin class extension. Rather than editing the CRUD controller, the bundle composes behaviour via a translatable admin trait/extension. Mirror that in Laravel with a trait on your resource class (TranslatableResource) so existing resources become translatable with one use statement.
  • Custom admin elements. If you need a translated field in a non-standard widget, register a custom datagrid column type / form type and override the Twig template via bundle template overrides — same idea as publishing Filament views.

Gotchas and Tips

  • Abandoned and framework-pinned. Last release 2020, targeting Symfony 3.4/4.x and PHP 7.x. It will fight Symfony 5+/6+ and modern Doctrine. Do not plan a Laravel integration around installing it; plan around re-implementing the three moving parts (locale state, tabbed form, scoped query).
  • Tight coupling. fsi/admin-bundle + fsi/translatable-bundle are hard requirements; you cannot use it as a standalone translation UI. Check those two packages' health before adopting.
  • Uniqueness must be per-locale. A unique index on slug alone breaks the moment you add a second language. Use a composite unique on (object_id, locale) or (locale, slug).
  • Session-based locale breaks stateless contexts. API calls, queued jobs, and console commands have no session — pass the locale explicitly or the listener silently uses the default.
  • Partial hydration on save. If the form only binds the active locale, other locales get nulled on flush. Verify with a Doctrine UnitOfWork dump or profiler before shipping.
  • Query cache keys. Translation-aware queries cached without the locale in the key return the wrong language. Disable result cache on these queries or include the locale in the cache key.
  • Debugging: use Symfony's profiler (doctrine and request panels) to confirm the locale reaching the query; if the wrong language appears, check listener priority — a later LocaleListener can overwrite the admin locale.
  • Extension points worth stealing: the LocaleManager (swap the storage), the translatable datagrid extension (port as a Laravel query scope + column), and the tabbed form type (port as a Filament Tabs schema component). These three are portable; the bundle wiring is not.
  • Score/health signal: zero stars and zero dependents means no community safety net. Treat any code you adapt from it as vendored, and pin the original for reference only.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource