2017 © Pedro Peláez
 

symfony-bundle translator-bundle

Easily edit Symfony2 translations while browsing your site

image

domis86/translator-bundle

Easily edit Symfony2 translations while browsing your site

  • Monday, June 6, 2016
  • by domis86
  • Repository
  • 1 Watchers
  • 5 Stars
  • 3,266 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

domis86/TranslatorBundle

SensioLabsInsight, (*1)

What is it ?

Symfony2 bundle which helps in translation., (*2)

A Symfony2 bundle which helps in editing of translations without need for editing the translations files. Edit can be performed via symfony WebDebugToolbar (translations from current request) or backend admin interface (all translations). Translations are stored in db and retrieved in a efficient way (+cached)., (*3)

The Symfony2 WebDebugToolbar shows number of translations used in current request: Domis86Translator in WebDebugToolbar, (*4)

If you click on it a Edit Dialog will appear where you can edit translations used in current request: Domis86Translator Edit Dialog, (*5)

Tranlation missing - indicates that translation for this language is missing - click and add it!, (*6)

Tranlation missing - Black text is current translation stored in db. Blue text means that it is translation loaded from file - via default Symfony2 Translator service (messages.en.yml etc). It will be used if there is no translation in DB., (*7)

In this example hello is translated to Hallo when language is germangerman, but when language is frenchfrench then it is translated to Bonjour (which resides somewhere in messages.fr.yml). Hit ( Click to edit ) above Bonjour to change it., (*8)

You can also browse [your_domain.com]/app_dev.php/domis86translator/backend to edit all translations used in your application., (*9)

Features

  • edit/add translations without need of messing with translations files
  • integration with Symfony2 WebDebugToolbar (dev env)
    • info how many translated/used messages was in request
  • robust Edit Dialog (js) activated by clicking on WebDebugToolbar
    • search/sort your translations by name, domain name, content
    • just click on translation, edit it in place and save
    • click on Help button in Dialog for more info
  • manage all translations from you application in Backend (same features as Edit Dialog)
  • translations are stored in DB, and cached per Action

Installation

Add the domis86/translator-bundle package to your require section in the composer.json file: ``` json ... "require": { ... "domis86/translator-bundle": "dev-master" }, ..., (*10)


Add the Domis86TranslatorBundle to your AppKernel: ``` php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Domis86\TranslatorBundle\Domis86TranslatorBundle(), // ... ); ... }

Enable this bundle and configure managed_locales in your config.yml: ``` yaml, (*11)

config.yml

domis86_translator: is_enabled: true managed_locales: [en, fr, de], (*12)


Enable Dialog for `dev` environment in your `config_dev.yml`: ``` yaml # config_dev.yml domis86_translator: is_web_debug_dialog_enabled: true

Add routes in your routing_dev.yml: ``` yaml, (*13)

routing_dev.yml

domis86_translator_routing: resource: "@Domis86TranslatorBundle/Resources/config/routing.yml" prefix: /domis86translator, (*14)


Update your database: ``` console php app/console doctrine:schema:update --force

Install assets ``` console php app/console assets:install, (*15)


#### Optional config: If your web server's DocumentRoot points to some other dir than symfony's `/web` dir then you can change `domis86_translator.assets_base_path` accordingly (default is `/bundles/domis86translator/`). Assuming your app.php url is `http://localhost/uglydirectory/web/app.php` then you should do: ``` yaml domis86_translator: managed_locales: [en, fr, de] assets_base_path: /uglydirectory/web/bundles/domis86translator/

Used libraries:

Latest Stable Version Total Downloads Latest Unstable Version License, (*16)

The Versions

06/06 2016

dev-master

9999999-dev http://github.com/domis86/TranslatorBundle

Easily edit Symfony2 translations while browsing your site

  Sources   Download

WTFPL

The Requires

 

by Dominik Frankowicz

translations ui bundle translator i18n

06/07 2015

dev-symfony-2-7

dev-symfony-2-7 http://github.com/domis86/TranslatorBundle

Easily edit Symfony2 translations while browsing your site

  Sources   Download

WTFPL

The Requires

 

by Dominik Frankowicz

translations ui bundle translator i18n

06/07 2015

v1.0

1.0.0.0 http://github.com/domis86/TranslatorBundle

Easily edit Symfony2 translations while browsing your site

  Sources   Download

WTFPL

The Requires

 

by Dominik Frankowicz

translations ui bundle translator i18n

31/03 2015

v0.3

0.3.0.0 http://github.com/domis86/TranslatorBundle

Easily edit Symfony2 translations while browsing your site

  Sources   Download

WTFPL

The Requires

 

by Dominik Frankowicz

translations ui bundle translator i18n

30/03 2015

v0.2

0.2.0.0 http://github.com/domis86/TranslatorBundle

Easily edit Symfony2 translations while browsing your site

  Sources   Download

WTFPL

The Requires

 

by Dominik Frankowicz

translations ui bundle translator i18n

03/12 2014

v0.1

0.1.0.0 http://github.com/domis86/TranslatorBundle

Easily edit Symfony2 translations while browsing your site

  Sources   Download

WTFPL

The Requires

 

by Dominik Frankowicz

translations ui bundle translator i18n