- Requires PHP 8.4+
- Requires Symfony 7.4|8.0
The bundle configuration has been updated. Update your config/packages/a2lix.yaml:
Before (v3):
a2lix_translation_form:
locales: [en, fr, de]
default_locale: enAfter (v4):
a2lix_translation_form:
enabled_locales: [en, fr, de] # Optional. Default from framework.enabled_locales
default_locale: en # Optional. Default from framework.default_locale
required_locales: [en] # Optional. Default []Key changes:
locales→enabled_locales
The default template has changed from Bootstrap 4 to Bootstrap 5:
Before:
templating: "@A2lixTranslationForm/bootstrap_4_layout.html.twig"After:
templating: "@A2lixTranslationForm/bootstrap_5_layout.html.twig"Or use the framework-agnostic layout (No JS required, compatible with Gecko browsers):
templating: "@A2lixTranslationForm/native_layout.html.twig"The Bootstrap 5 template uses the new tab API with data-bs-toggle and data-bs-target attributes.
New options have been added with this type that rely on AutoType from A2lixAutoFormBundle:
$builder->add('translations', TranslationsType::class, [
'translatable_class' => MyEntity::class, // Required !
'gedmo' => true, // Required only if Gedmo !
'default_locale' => ... // Optional. From LocaleExtension
'enabled_locales' => ... // Optional. From LocaleExtension
'required_locales' => ... // Optional. From LocaleExtension
'locale_labels' => ... // Optional. From LocaleExtension
'theming_granularity' => ... // Optional. From LocaleExtension
'children_excluded' => ... // Optional. See AutoFormBundle
'children_embedded' => ... // Optional. See AutoFormBundle
'children_groups' => ... // Optional. See AutoFormBundle
'children' => ... // Optional. See AutoFormBundle
'builder' => ... // Optional. See AutoFormBundle
]);Key changes:
translatable_classis now required
The LocaleProviderInterface::getLocales() method has been renamed to LocaleProviderInterface::getEnabledLocales()
New Twig component for locale switching:
<twig:A2lixTranslationForm:LocaleSwitcher />Available renders:
basic: Inline badgesdropdown: Bootstrap dropdown menu