johnkhansrc/api-platform-stream-translate-bundle
A Symfony bundle for API Platform that integrates stream-based translation, helping expose translated API resources and content through configurable workflows. A lightweight option for adding translation support to API Platform projects.
Architecture fit — stack mismatch remains the headline finding, unchanged by 3.2.0. Despite being filed as a "Laravel/PHP package," this is a Symfony bundle built for API Platform, not a Laravel package. It has no service provider, no Laravel auto-discovery, and depends on API Platform's serializer/normalizer pipeline and Symfony's translation contracts. If our target application is Laravel, this is a hard stop and the evaluation ends here. It is only relevant if we run Symfony + API Platform as our API layer; there it occupies a narrow, well-understood extension point — decorating the normalization step to swap property values for locale-specific ones at serialization time.
What 3.2.0 actually changes — and what it doesn't. The release is a single merged PR titled "Chore/upgrade symfony." That is a maintenance/version-matrix change, not a feature, not a breaking-change note, not a deprecation announcement. It is the first signal of upstream activity since 2023-12-01, which is mildly positive, but it is evidence of a commit, not evidence of correctness. We do not yet know from the release notes whether the upgrade:
getSupportedTypes() normalizer signature (the usual breakage point);doctrine/annotations-based @Translate with attribute-based #[Translate] for Symfony 7 compatibility.All three of those were open risks in the prior assessment, and 3.2.0 plausibly touches at least one of them. But "plausibly" is not verification, and the changelog gives us nothing to act on. Treat the version matrix as still unverified until we read the diff and composer.json.
Integration feasibility. Mechanically unchanged: Composer install, register the bundle, annotate properties. The concept is sound and small — a per-property translate hook in the read path. The actual code surface is likely a handful of classes. Feasibility still dies or lives on the version matrix; 3.2.0 makes that matrix more likely to resolve, not resolved.
Technical risk — still high, marginally rotated. The prior assessment flagged Symfony 7 / API Platform 3.3 compatibility as the leading technical risk. 3.2.0 partially addresses that specific axis. Everything else is untouched:
Key questions — revised for 3.2.0:
composer.json actually constrain — minimum and maximum Symfony and API Platform versions? Did it drop support for any version we run?getSupportedTypes() (API Platform 3.3+), and is configuration attribute-based (#[Translate]) or still annotation-based (@Translate, deprecated)?translator (file-based, cacheable) or a database table (N+1 risk on collections)?Accept-Language, a query parameter, or a service-level default — and what is the documented locale fallback chain?Stack fit. Viable only on Symfony 6.x/7.x + API Platform 3.x, now with a better — but still unconfirmed — chance of resolving on a modern matrix. For our Laravel services, the recommendation is unchanged: do not adopt; the equivalent behavior is a JsonResource / API Resource transformation with a translation service or spatie/laravel-translatable for stored multilingual fields. Those are supported, adopted, and documented. Reaching across ecosystems for a near-zero-adoption bundle is not a trade a TPM should sponsor.
Migration path (if we are on Symfony). Do not let the annotation — or attribute — become load-bearing. Unchanged in principle, with 3.2.0 adding one step at the front.
LocalizedValueResolver) so replacing it with a ~40-line normalizer decorator is a one-file change.Compatibility checklist. Verify composer.json constraints against our PHP version, API Platform major, symfony/translation, and the NormalizerInterface signature (the 3.3+ getSupportedTypes() requirement is the usual breakage point — 3.2.0 may or may not have addressed it). Confirm serializer decoration ordering against any other normalizers we already stack; decorator precedence conflicts are a common and confusing failure.
Sequencing guardrail. Treat this as a time-boxed spike, not a dependency. Gate promotion to production on: passing CI on our exact version matrix, documented fallback behavior, and a benchmark showing no measurable overhead on our largest collection endpoints. A chore release does not relax any of these gates.
Maintenance. Adopting this means we own it. 3.2.0 is a mildly encouraging signal that the maintainer is still present, but one chore PR in a year and a half is not a maintenance commitment we can plan capacity against. The code is small enough that maintenance cost is modest, but it is a permanent line item on our dependency ledger with no counterparty.
Support. No vendor, no SLA, no issue triage. Any defect is ours to diagnose. For a component sitting directly on the client-facing API response path, that is meaningful exposure — translation bugs are silent and user-visible, the worst combination. The release notes for 3.2.0 do not mention tests or CI, so assume neither.
Scaling. Risk concentrates in list/collection endpoints. Per-entity, per-property translation hooks executed across a paginated result set can multiply into hundreds of resolution calls per request. If resolution is served by Symfony's translator with a warmed cache, this is a rounding error. If DB-backed, expect N+1 and a latency cliff that appears only under production data volumes. Benchmark the largest collection endpoint, not a detail view — and re-check it after the Symfony upgrade, since a major bump can change caching or container compilation behavior.
Failure modes to design for:
Ramp-up. The technology is trivial to learn — an engineer familiar with API Platform absorbs it in under a day. The real ramp-up is organizational: convincing the team to fork and own a package with zero external validation. The recommendation stands: treat this as a reference implementation, not a dependency. Read it — and specifically read the 3.2.0 diff, since it is the cheapest available answer to our compatibility questions — then implement the decorator in-house behind our own interface. Roughly a day of work, no supply-chain, version-compatibility, or bus-factor exposure, and full control over fallback semantics and caching.
How can I help you explore Laravel packages today?