ibrows / translation-helper-bundle
Symfony Translation Helper Bundle
Installs: 8 097
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- symfony/framework-bundle: ~2.7
- symfony/symfony: ~2.7 |3.4
README
Provide a TranslationWrapper which can create missing translations for you
Enable/disbale creation over config.
Normalize translationkeys
Decorate Missing Keys
Use your own customized Creator
Currently only YML Translation-Creator shipped in the Bundle
Install & setup the bundle
-
Add IbrowsTranslationHelperBundle in your composer.json:
{ "require": { "ibrows/translation-helper-bundle": "~1.0", } }
-
Now tell composer to download the bundle by running the command:
$ php composer.phar update ibrows/translation-helper-bundle
Composer will install the bundle to your project's
ibrows/translation-helper-bundle
directory. ( PSR-4 ) -
Add the bundle to your
AppKernel
class// app/AppKernerl.php public function registerBundles() { $bundles = array( // ... new \Ibrows\TranslationHelperBundle\IbrowsTranslationHelperBundle(), // ... ); // ... }
-
Sample Configuration
ibrows_translation_helper: translator: normalize: true create: true creator: ibrows_translation_helper.defaultcreator decorate: !!!%s ignoreDomains: [] deleteCache: false creator: format: yml path: %kernel.root_dir%/../src/Ibrows/SampleBundle/Resources/translations decorate: ___%s backup: false ucFirst: false
Avoid unnecessary translations in choices
Use this in your form_div_default_layout.html.twig
{% extends 'form_div_layout.html.twig' %}
{% use '@IbrowsTranslationHelper/form_div_layout_trans_fix.html.twig' %}
And use this for SonataAdmin
sonata_doctrine_orm_admin: entity_manager: ~ templates: form: - 'IbrowsTranslationHelperBundle::form_admin_fields.html.twig'
sonata_admin: templates: filter: IbrowsTranslationHelperBundle::form_admin_fields.html.twig