GithubHelp home page GithubHelp logo

abandroid / ibrowssonatatranslationbundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chugas/successsonatatranslationbundle

0.0 2.0 0.0 284 KB

Translation integration for SonataAdminBundle

License: Other

PHP 89.85% HTML 10.15%

ibrowssonatatranslationbundle's Introduction

SonataTranslationBundle

The SonataTranslationBundle is an integration of the LexikTranslationBundle into the SonataAdminBundle.

image

Installation

Add the following lines in your composer.json:

{
    "require": {
		"ibrows/sonata-translation-bundle" : "dev-master",
    }
}

To start using the bundle, register the SonataTranslationBundle and LexikTranslationBundle in your application's kernel class:

<php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
		new Lexik\Bundle\TranslationBundle\LexikTranslationBundle(),
		new Ibrows\SonataTranslationBundle\IbrowsSonataTranslationBundle(),
    );
)

Configuration

SonataTranslationBundle

No initial configuration is necessary.

However there are some options you can configure in order to edit the look. Below the default configuration is shown:

# app/config/config.yml
ibrows_sonata_translation:
    defaultDomain: messages
	editable:
    	mode: inline		 # Mode of editable, can be popup or inline
		type: textarea		 # Type of input. Can be text|textarea|select|date|checklist and more
		emptytext: Empty 	 # text to display on empty translations
		placement: top		 # ingnored for inline mode

LexikTranslationBundle

The minimal configuration consists of:

# app/config/config.yml
lexik_translation:
    fallback_locale: en      # (required) default locale to use
    managed_locales: [en]    # (required) locales that the bundle have to manage

For additional configuration options please refer to the official documentation

In order to have some keys shown up in the admin panel, you have to import the translation files first. This is done through a command offered by LexikTranslationBundle:

./app/console lexik:translations:import [bundleName] [--cache-clear] [--force] [--globals]

Once again refer to the official documentation for additional information.

Usage

To include the bundle in the admin dashboard, add group "group.translation" to dashboard

# app/config/config.yml
sonata_admin:
    dashboard:
        groups:
            group.translation:
                label: Translation
                items: ~ 

There really is not more to say about it ;).

ibrowssonatatranslationbundle's People

Contributors

mmf-amarcos avatar dominikzogg avatar aitboudad avatar helios-ag avatar gladhon avatar mikemeier avatar pawelkolanowski avatar endroid avatar

Watchers

 avatar James Cloos 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.