pix-art / lexik-translation-sonata-bundle
A Sonata bundle to create a lexik translation admin interface
Installs: 9 074
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 5
Open Issues: 0
Requires
- php: >=5.5.0
- lexik/translation-bundle: ~4.0
- sonata-project/admin-bundle: ^3.9
README
Sonata extension for https://github.com/lexik/LexikTranslationBundle
Install with composer:
# Latest stable
composer require pix-art/lexik-translation-sonata-bundle 1.0
# For latest unstable version
composer require pix-art/lexik-translation-sonata-bundle dev-master
Register the bundle with your kernel:
// in AppKernel::registerBundles()
$bundles = array(
// ...
new Lexik\Bundle\TranslationBundle\LexikTranslationBundle(),
new LexikTranslationSonataBundle\LexikTranslationSonataBundle(),
// ...
);
Then install the required assets:
php app/console assets:install
Routing:
lexik_translation_edition:
resource: "@LexikTranslationSonataBundle/Resources/config/routing.yml"
prefix: /admin
Config:
lexik_translation:
fallback_locale: [nl]
managed_locales: [nl,fr,en]
base_layout: "LexikTranslationSonataBundle::translations_layout.html.twig"
Auto Discovery:
This will transform you |trans function, to auto discover this translation if it's not found. Make sure the domain is declared if you want it auto discovered
lexik_translation_sonata:
auto_discover: true
auto_discover_domains: [messages]