Giter VIP home page Giter VIP logo

ibrowstranslationhelperbundle's Introduction

IbrowsTranslationHelperBundle

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

ibrowstranslationhelperbundle's People

Contributors

dominikzogg avatar ronaldburch avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.