- How does this bundle improve SEO for multilingual Sulu sites?
- The bundle generates locale-specific filenames (e.g., `product-de.jpg`) while preserving original files, ensuring search engines index content in the correct language. It also adds SEO metadata like titles and descriptions per locale via the admin UI, directly supporting international SEO best practices.
- Can I install this in an existing Sulu 3.x project without breaking existing media URLs?
- Yes, the bundle uses a compiler pass to extend Sulu’s default `FormatManager` without replacing it. Existing media URLs remain functional unless explicitly overridden in your templates. Always test in staging first to confirm backward compatibility.
- What PHP/Symfony versions does this bundle support?
- The bundle requires PHP 8.2+, Symfony 7.x, and Sulu CMS 3.x. It leverages modern PHP features like named arguments and attributes, so ensure your environment meets these minimum requirements before installation.
- How do I handle missing translations (e.g., fallback from German to English)?
- The bundle relies on Symfony’s `app.request.locale` for locale detection. If a translation is missing, it falls back to the default locale configured in Sulu. For CLI or API calls, you must explicitly pass a locale to the Twig functions (e.g., `sulu_translated_media_url(media, '800x', 'en')`).
- Are the generated translated URLs cacheable (e.g., Varnish, Symfony Cache)?
- Yes, translated URLs can be cached. The bundle uses `FormatCacheInterface` (since v3.0.3), so ensure your caching layer (e.g., Redis, Symfony Cache) is properly configured. Cache keys are structured to include the locale and format, enabling granular invalidation.
- Does `sulu_translated_media_urls()` support responsive images (srcset) for all formats?
- Yes, the `sulu_translated_media_urls()` function generates URLs for all configured formats (default + WebP/AVIF) in the requested locale. This makes it ideal for `<picture>` elements or `srcset` attributes, ensuring optimal delivery across devices.
- How do I preserve original filenames in storage while serving translated paths?
- 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 symlinks or redirects to the original. The bundle handles this automatically during URL generation, so no manual file management is required.
- Will this bundle work with Sulu 4.x when it’s released?
- There are no official guarantees yet, but the bundle’s architecture is designed to extend Sulu’s core Media entity. Check the [GitHub repository](https://github.com/alengodev/SuluTranslatedMediaBundle) for updates or compatibility announcements. Always test in a staging environment before upgrading.
- Can editors bulk-edit translations (e.g., via Sulu’s Data Importer)?
- Currently, the bundle provides an ‘Additional Data’ tab for manual editing of translations. Bulk editing isn’t natively supported, but you could extend the admin API or use Sulu’s Data Importer to update `me_media_translations` programmatically with custom scripts.
- Are there validation rules for SEO filenames (e.g., length, URL-safe characters)?
- The bundle enforces basic URL-safe character validation (e.g., no spaces or special characters) for SEO filenames. However, custom validation rules can be added by extending the `Media` entity or overriding the admin form type. Check the `seoFilename` field constraints in the entity for current rules.