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

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

johnkhansrc/api-platform-stream-translate-bundle is a Symfony bundle that connects API Platform resources to a stream-based translation service, so multilingual representations can be generated on the fly instead of being stored once per locale. It hooks into the serialization and request lifecycle, translating resource properties as the response is streamed.

  • Seamless API Platform integration through a configurable translator service
  • On-the-fly translation of serialized resource fields
  • Streamed, low-memory handling for large collections and payloads
  • Per-locale configuration with locale negotiation
  • Minimal setup via standard Symfony bundle configuration
Frequently asked questions about Api Platform Stream Translate Bundle
Is johnkhansrc/api-platform-stream-translate-bundle a Laravel package?
No. Despite being listed as a Laravel/PHP package, johnkhansrc/api-platform-stream-translate-bundle is a Symfony bundle built for API Platform. It has no Laravel service provider or auto-discovery and depends on API Platform's serializer/normalizer pipeline plus Symfony translation contracts. For a Laravel app, treat it as a hard stack mismatch.
How do I install and register the Stream Translate bundle in Symfony?
Use Composer to require johnkhansrc/api-platform-stream-translate-bundle, then enable the bundle in your Symfony application's bundle configuration. After that, annotate the entity properties you want translated. Exact service configuration is minimal in the repo, so confirm the required bundle registration and annotation namespace against the package source before wiring it into a shared codebase.
Does this bundle support API Platform 3.x and Symfony 7?
Not safely. The last release was 2023-12-01, which predates API Platform 3.2's getSupportedTypes normalizer change and Symfony 7's removal of doctrine/annotations. An annotation-driven bundle from that era is likely broken or deprecated on a modern Symfony/API Platform stack. Check composer.json constraints and run a spike before assuming compatibility.
How do I configure translations for entity properties with this bundle?
The intended flow is Composer install, bundle registration, and a per-property annotation that marks entity values for translation during API Platform serialization. The bundle is described as lightweight, so configuration should be small. The available context does not document the full catalog setup, so verify whether it relies on Symfony's translator service or custom configuration.
Does the bundle use annotations or PHP attributes?
The package is described as annotation-driven, which usually means @Translate-style Doctrine annotations. Symfony 7 removed doctrine/annotations, so modern projects need PHP attributes such as #[Translate]. The provided context does not confirm attribute support, so inspect the source and test on PHP 8.2/8.3 before adopting it.
Where does the bundle get the locale from Accept-Language or a query parameter?
The locale resolution behavior is not documented in the available context. It may follow Symfony's request locale or translator default, but it is unclear whether it honors Accept-Language, a query parameter, or a service-level setting. The fallback chain also needs verification, especially for streamed and paginated API Platform responses.
What happens if a translation is missing for a property value?
Missing-translation behavior is not specified, and this is a client-visible risk. The bundle could return the raw translation key, fall back to the source language, or emit an empty value. Write a test case for missing keys and unsupported locales before exposing the endpoint to consumers.
Can I use this package in production if it has zero stars and no releases since 2023?
Treat it as high risk for production. It has zero stars, zero dependents, no forks, a single release, bus factor one, no CI evidence, and no security disclosure path. If you proceed, pin the Composer constraint, fork it under your org, add CI on PHP 8.2/8.3 with API Platform 3.x, and wrap usage behind your own interface so replacement stays a one-file change.
What is the Laravel alternative to stream translation for API Platform responses?
In Laravel, do not cross ecosystems for this. Use an API Resource or JsonResource transformation with a translation service, or use spatie/laravel-translatable for stored multilingual fields. Those options are supported, adopted, and documented, and they avoid binding presentation logic to an unmaintained Symfony bundle.
Does the bundle translate on write/denormalization or only on read?
The bundle appears to hook into the read path by decorating normalization, swapping property values at serialization time. Write and denormalization behavior is not documented, so confirm it is read-only and does not mutate persisted entity values. If it touches writes, round-trip data loss is a real risk, and caching or search indexes could receive locale-mutated data.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections