Skip to content

v1.4.0 — Event Dispatching & Locale Validation

Choose a tag to compare

@CreativeNative CreativeNative released this 22 Sep 20:02
· 236 commits to master since this release

What's Changed

  • Added: PRE_TRANSLATE and POST_TRANSLATE events with TranslateEvent for flexible extension points
  • Added: Locale configuration validation with clear error handling for unsupported locales
  • Added: Attribute-based configuration for listeners:
    • #[AsEventListener(event: KernelEvents::REQUEST, method: 'onKernelRequest', priority: 2)] in LocaleFilterConfigurator
    • #[AsDoctrineListener(event: Events::prePersist)]
    • #[AsDoctrineListener(event: Events::postLoad)]
    • #[AsDoctrineListener(event: Events::onFlush)] in TranslatableEventSubscriber
  • Improved: Translation process with better lifecycle hooks and attribute handling
  • Prepared: ToDo for introducing a dedicated TranslationCacheService (see Issue #3)

Why It Matters

This release expands the translation system with proper event dispatching, making it easier for developers to hook into the translation lifecycle.
It also strengthens locale handling by enforcing configuration checks, ensuring invalid locales never slip through.

  • Flexibility: Developers can now listen to translation lifecycle events (PRE_TRANSLATE, POST_TRANSLATE)
  • Consistency: Locale validation ensures only supported locales are used
  • Modernization: Doctrine and Symfony events are now configured via PHP attributes and service YAML for reliability
  • Maintainability: Clear ToDos for caching refactor and stricter attribute handling

Full Changelog: v1.3.1...v1.4.0