Weave Code
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
Sulu Translated Media Bundle

Sulu Translated Media Bundle Laravel Package

alengo/sulu-translated-media-bundle

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Sulu Translated Media Bundle
How do I enable translated media filenames in Sulu CMS 3.x without breaking existing media URLs?
The bundle replaces Sulu’s default `FormatManager` via a compiler pass, ensuring backward compatibility. Existing media URLs remain functional unless explicitly overridden in the admin panel. No manual configuration is needed—just install the bundle and run the database migration.
Does this bundle support WebP image formats alongside translated filenames?
Yes, the bundle includes WebP support through Symfony’s `MimeTypeGuesser` and Sulu’s image processing pipeline. The `sulu_translated_media_urls()` Twig function generates both default and WebP URLs for responsive images, compatible with `<picture>` tags and `srcset`.
What happens if a translation for a locale (e.g., German) is missing? Does it fall back to the default?
The bundle checks `app.request.locale` first. If no translation exists for the requested locale, it falls back to the default locale (configured in Sulu) or uses the original filename. You can also manually set fallback locales in the admin’s ‘Additional Data’ tab.
Can I use this bundle with Sulu 4.x when it’s released, or is it locked to Sulu 3.x?
The bundle is currently built for Sulu 3.x and Symfony 7.x. While no official Sulu 4.x support is guaranteed yet, the architecture (compiler passes, Twig extensions) is designed to minimize migration effort. Check the GitHub repo for updates or open an issue for compatibility tracking.
How do I cache translated media URLs to reduce database lookups in high-traffic sites?
The bundle uses Symfony’s `FormatCacheInterface` (since v3.0.3) for caching translated URLs. For Varnish or Redis, ensure your cache keys include the locale and media ID (e.g., `media_123_de_800x`). Test cache invalidation after bulk media updates to avoid stale URLs.
Does the bundle allow bulk-editing translations for SEO filenames in the Sulu admin?
Currently, translations must be edited individually in the ‘Additional Data’ tab of the Sulu Media admin. For bulk operations, consider using Sulu’s Data Importer extension or writing a custom CLI script to update `me_media_translations` directly.
What validation rules are applied to SEO filenames (e.g., length, URL-safe characters)?
The bundle enforces basic URL-safe validation (alphanumeric, hyphens, underscores) and a maximum length of 255 characters. Invalid filenames are rejected in the admin UI with a validation error. For stricter rules, extend the `MediaTranslations` entity or add custom validation in your project.
How are original filenames preserved in storage while serving translated paths (e.g., /uploads/original/red-shoes.jpg vs. /uploads/red-shoes-de.jpg)?
Original files are stored under their native names (e.g., `/uploads/original/red-shoes.jpg`), while translated paths (e.g., `/uploads/red-shoes-de.jpg`) are symlinked or served via a filesystem abstraction layer. The bundle handles this transparently—no manual file management is required.
Are there any known conflicts with other Sulu bundles (e.g., SuluMediaBundle, custom media processors)?
The bundle integrates with Sulu’s core `Media` entity and admin API without conflicts. However, if you’ve customized Sulu’s `FormatManager` or media processing pipeline, test thoroughly in staging. Custom media processors should extend the bundle’s `TranslatedFormatManager` for full compatibility.
What’s the performance impact of translated filenames on high-traffic sites with thousands of media assets?
Translated filenames add a database lookup per request to resolve the locale-specific path. Benchmark your setup: for low-to-medium traffic, the impact is negligible. For high traffic, optimize with caching (e.g., Redis for `me_media_translations`) or consider a CDN like Cloudflare to offload path resolution.
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope