skippy565/object-translation-bundle
A Symfony bundle for locale-aware translation of object properties, helping you store and retrieve localized field values without duplicating entities. Useful for multilingual content and simple i18n workflows.
Framework mismatch — first-order finding. Despite being scored in a Laravel/PHP package set, this is a Symfony bundle, not a Laravel package. It ships as a bundle (*Bundle class, DI Extension, YAML/XML service config, compiler passes) and almost certainly integrates via Doctrine ORM event subscribers rather than Eloquent. Nothing in it is expected to be installable via composer require into a Laravel app and "just work." Any evaluation of it as a Laravel dependency should start from the assumption that the integration cost is a port, not an install.
Architecture fit. The likely design is a Doctrine postLoad/onFlush listener or a translator decorator that swaps object properties based on the current locale, backed by a translation storage table keyed by (object class, object id, field, locale). That concept is sound and well-trodden — it is essentially what Doctrine Translatable and spatie/laravel-translatable do. The value here is therefore conceptual, not code-level: read it for the data model, then implement against a maintained library.
Integration feasibility. Feasibility into a Laravel codebase is low as-is, moderate as a reference implementation. Concretely:
HasTranslations trait, or a query scope.Configuration.php) → must be rewritten as config/object-translation.php.Technical risk — high.
ContainerAware, deprecations) and on Symfony 5/6/7.Key questions to resolve before committing engineering time.
composer.json declare — PHP constraint, Symfony constraint, test/CI setup?doctrine/doctrine-extensions Translatable or KnpLabs bundles? If the delta is small, this package has no reason to exist.Stack fit: poor. For Laravel, the maintained alternatives — spatie/laravel-translatable (JSON-column translations, ~2k stars, active) or astrotomic/laravel-translatable (side-table model) — dominate this package on every axis: docs, tests, PHP 8/Laravel 11 support, community. Recommending a direct port is only defensible if the existing data model already matches this package's schema.
Recommended path: reference-implement, don't fork. Use the repository as a design document for one spike, then build on a maintained library.
Migration / port path (if we do lift code):
phpstan/rector in dry-run to quantify PHP 8 upgrade cost, write one failing test against a real schema.HasTranslations trait → accessor/mutator (getAttribute override or Attribute casts) → migration for the storage table (unique index on (translatable_type, translatable_id, field, locale)) → service provider binding a Translator resolver.Compatibility. Assume Symfony 3/4-era and PHP 7.1–7.3. Do not attempt to install it alongside a modern Symfony; do not expect it to install at all on PHP 8.3. Pin whatever environment you spike in.
Sequencing.
acme/object-translation) with an explicit owner, not as a public dependency.Maintenance: we own it outright. Upstream is dormant; no security patches, no PHP-version bumps, no Symfony/Laravel compatibility work. Forking means accepting a permanent line item — realistically a few days per year of dependency-drift maintenance, plus more if PHP major versions land. Budget it in the platform team's roadmap or don't take the dependency.
Support. No documentation beyond a README, no community, no Stack Overflow corpus, no issue history to mine for failure modes. Onboarding a new engineer means "read the source." The codebase is small enough that this is hours rather than weeks — that is the package's single genuine operational strength.
Scaling. Unknown and unproven. Watch specifically for:
WHERE filtering degrades badly — a strong argument for the side-table model or a maintained alternative.Failure modes to instrument.
null vs. the key vs. empty string — inconsistent contracts here are a recurring source of template bugs.Ramp-up. Low for reading, moderate for owning. Any engineer can understand the concept in an afternoon; owning the port safely requires someone who has debugged ORM hydration and locale scoping before. Net: do not adopt as a dependency; treat as a design reference and a source of ~200 lines of logic under MIT. If the question is "should this be in our Laravel stack," the answer is no — the correct move is spatie/laravel-translatable, with this repo read once for schema ideas and then archived.
How can I help you explore Laravel packages today?