定制 ibrows/translation-helper-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ibrows/translation-helper-bundle

Composer 安装命令:

composer require ibrows/translation-helper-bundle

包简介

Symfony Translation Helper Bundle

README 文档

README

Build Status

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

  1. Add IbrowsTranslationHelperBundle in your composer.json:

    {
        "require": {
            "ibrows/translation-helper-bundle": "~1.0",
        }
    }
  2. 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 )

  3. Add the bundle to your AppKernel class

    // app/AppKernerl.php
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new \Ibrows\TranslationHelperBundle\IbrowsTranslationHelperBundle(),
            // ...
        );
        // ...
    }
  4. 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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固