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

Api Platform Stream Translate Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • raised the minimum Symfony constraint (and dropped older majors), or merely widened the upper bound;
  • adopted the API Platform 3.3+ getSupportedTypes() normalizer signature (the usual breakage point);
  • replaced 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:

  • Zero adoption signal. 0 stars, 0 dependents, 0 forks. No production references, no community bug reports, no third-party validation of correctness. We would be the first serious consumer.
  • Thin release history, now with a gap. Two releases across ~18+ months, one of which is a chore. Cadence remains project-of-one; a single maintenance commit does not constitute velocity, and we have no roadmap or issue triage to plan against.
  • Architectural smell. Mutating persisted entity values during serialization couples presentation to persistence. Locale becomes an implicit input to a layer that should be a pure projection. Defensible for read-only display strings, dangerous if the same entities feed internal services, caching layers, or search indexes.
  • Bus factor 1, no security disclosure path, no visible CI evidence in the release.

Key questions — revised for 3.2.0:

  1. Is our API layer Symfony + API Platform at all, and at which major version?
  2. New: what does 3.2.0's composer.json actually constrain — minimum and maximum Symfony and API Platform versions? Did it drop support for any version we run?
  3. New: does 3.2.0 implement getSupportedTypes() (API Platform 3.3+), and is configuration attribute-based (#[Translate]) or still annotation-based (@Translate, deprecated)?
  4. Does the bundle operate read-only, or does it attempt denormalization on writes (round-trip data loss risk)?
  5. Where does the translation catalog live — Symfony translator (file-based, cacheable) or a database table (N+1 risk on collections)?
  6. Does it honor Accept-Language, a query parameter, or a service-level default — and what is the documented locale fallback chain?
  7. Behavior on missing translation: raw key (client-visible defect) or source-language fallback?
  8. How does "stream" behave — does it buffer a streamed response, and does it survive API Platform's paginated/partial-output paths?

Integration Approach

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.

  • Step 0 (new): read the 3.2.0 diff before anything else. It is one PR; reading it is an hour, and it collapses three of our open questions at once. Confirm the Symfony/API Platform constraints and the normalizer signature from source, not from the changelog.
  • Vendor it as a pinned Composer dependency with an explicit constraint, and immediately fork it under our org namespace if the spike succeeds.
  • Wrap its usage behind our own thin interface (e.g., LocalizedValueResolver) so replacing it with a ~40-line normalizer decorator is a one-file change.
  • Sequence: read 3.2.0 diff → stack verification → fork + add CI (PHP 8.2/8.3, API Platform 3.x) → single-entity spike → benchmark against a hand-written decorator → build-vs-fork decision. Expect the build option to win; the functionality is small enough that owning it is cheaper than owning someone else's barely-maintained code.

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.

Operational Impact

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:

  • Missing catalog entry → raw translation keys leaking into API responses (client-visible defect, high reputational cost, low detection without contract tests).
  • Locale fallback misconfiguration → silently wrong-language payloads that pass all schema validation.
  • API Platform or Symfony major upgrade → container compile failure, discovered late, blocking a platform upgrade. 3.2.0 lowers this risk but does not retire it; the next major is still on us.
  • Serializer decorator conflict → translation applied twice or not at all, depending on registration order.
  • Residual annotation dependency → hard break on Symfony 7 if 3.2.0 did not migrate to attributes. Verify from the diff.
  • Streamed responses → buffering or partial-translation inconsistency on large payloads.

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.

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.
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
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core