ibrows/translation-helper-bundle
Composer 安装命令:
composer require ibrows/translation-helper-bundle
包简介
Symfony Translation Helper Bundle
README 文档
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-bundledirectory. ( PSR-4 ) -
Add the bundle to your
AppKernelclass// 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
统计信息
- 总下载量: 8.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-03-25