Download the PHP package a2lix/translation-form-bundle without Composer
On this page you can find all versions of the php package a2lix/translation-form-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download a2lix/translation-form-bundle
More information about a2lix/translation-form-bundle
Files in a2lix/translation-form-bundle
Package translation-form-bundle
Short Description Translate your doctrine objects easily with some helpers
License MIT
Homepage https://github.com/a2lix/TranslationFormBundle
Informations about the package translation-form-bundle
A2lix TranslationForm Bundle
A small, flexible Symfony bundle that helps you build forms to manage translations for Doctrine entities. It integrates with common translation strategies (Gedmo Personal Translation and Knp DoctrineBehaviors) and provides form types, helpers and Twig components to make working with multilingual data easier.
Key features
- Easy form handling for translatable entities (Knp & Gedmo strategies).
- Support for one-record-per-locale patterns via
TranslationsFormsType. TranslatedEntityTypefor entity choice labels using translations.- Centralized locale configuration via
LocaleProvider. - Twig helpers and a
LocaleSwitchercomponent.
[!NOTE] Use A2lixAutoFormBundle for automatic form generation and customization.
[!TIP] A complete demonstration is also available at a2lix/demo.
Screenshot example
Installation
- Install the bundle with Composer:
Basic configuration
Add a minimal configuration in config/packages/a2lix.yaml:
If you keep the default setup, the bundle will automatically prepend the chosen form theme (Bootstrap 5 layout by default) into Twig's form_themes.
Compatibility: Gedmo & Knp
- Gedmo PersonalTranslation: Fully supported. When using Gedmo's personal translation mapping, the bundle renders translation fields as separate translation objects and manages creation and removal of
Gedmotranslation entities. - KnpDoctrineBehaviors: Fully supported. For Knp-style translations (one translation object per locale), fields are bound directly to locale forms.
Usage examples
TranslationsType (Knp or Gedmo)
TranslationsFormsType (one-record-per-locale)
TranslatedEntityType (entity choices with translation labels)
Locale selection widget
Twig helpers & components
Locale rendering function:
LocaleSwitcher component:
LocaleProvider
The bundle centralizes locale configuration through a LocaleProviderInterface. By default, SimpleLocaleProvider is registered and configured from bundle settings. You can replace it with your own service by changing locale_provider in the bundle configuration.
Integration with AutoFormBundle
This bundle integrates cleanly with a2lix/auto-form-bundle. When using AutoType with translatable entities, TranslationsType and TranslationsFormsType can be automatically configured and rendered based on entity metadata and bundle options.
License
This package is available under the MIT license — see the LICENSE file.
All versions of translation-form-bundle with dependencies
a2lix/auto-form-bundle Version ^1.0
symfony/config Version ^7.4|^8.0
symfony/dependency-injection Version ^7.4|^8.0
symfony/doctrine-bridge Version ^7.4|^8.0
symfony/event-dispatcher Version ^7.4|^8.0
symfony/form Version ^7.4|^8.0
symfony/http-kernel Version ^7.4|^8.0
symfony/intl Version ^7.4|^8.0
symfony/options-resolver Version ^7.4|^8.0
symfony/translation Version ^7.4|^8.0
symfony/ux-twig-component Version ^2.31|^3.0