apploud / nette-doctrine-translatable
Extension for Nette framework that simplifies translating of Doctrine entities.
Installs: 16 508
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
pkg:composer/apploud/nette-doctrine-translatable
Requires
- php: >=7.1
- doctrine/orm: *
- nette/di: ^3.0
- prezent/doctrine-translatable: ^2.0
Requires (Dev)
- nette/bootstrap: ^3.0
- nette/tester: ^1.7
This package is auto-updated.
Last update: 2025-10-08 01:11:01 UTC
README
Translatable behaviour extension for Doctrine2 as Nette extension
Installation
The best way to install TranslationsConverter is using Composer:
$ composer require apploud/nette-doctrine-translatable
You can enable the extension using your neon config.
extensions: translatable: Apploud\Doctrine\Translatable\DI\TranslatableExtension
You also need to have an instance of Doctrine\ORM\EntityManager defined as a service with autowiring turned on (or pass it in configuration).
Configuration
Configuration example with all possible settings:
translatable: entityManager: @doctrine.entityManager defaultLocale: defaultLocale currentLocale: currentLocale fallbackLocale: fallbackLocale currentLocaleResolver: [@resolverService, 'getCurrentLocale'] fallbackLocaleResolver: [@resolverService, 'getFallbackLocale']
All settings are optional. If entityManager is missing, it will be autowired. Any other value defaults to NULL. Locale resolver can be any callable.
When determining current and fallback locales, priorities are:
- locale value
- value from locale resolver
- default locale