2017 © Pedro Peláez
 

symfony-bundle personal-translations-widget-bundle

Adds translations widget based on Personal translations

image

usetwice/personal-translations-widget-bundle

Adds translations widget based on Personal translations

  • Friday, June 28, 2013
  • by usetwice
  • Repository
  • 0 Watchers
  • 0 Stars
  • 185 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Installation

Add to composer.json:, (*1)

"ladela/personal-translations-widget-bundle" : "dev-master"

Add to AppKernel.php:, (*2)

new Ladela\PersonalTranslationsWidgetBundle\PersonalTranslationsWidgetBundle(),

Copy or symlink file:, (*3)

Resources/views/Form/translatable_field_widget.html.twig located in the bundle directory
~~~~

to
~~~~
/app/Resources/views/translatable_field_widget.html.twig locate din the project root

Languages configuration

config.yml, (*4)

personal_translations_widget:
  getter: your-languages-getter-service-id

the service class must implement TranslationsGetterInterface and return array of language-key => label pairs, (*5)

use Ladela\PersonalTranslationsWidgetBundle\TranslationsGetter\TranslationsGetterInterface;

class LanguagesGetter implements TranslationsGetterInterface
{
  public function getLanguages()
  {
    return array('en' => 'English', 'de' => 'Deutsch');
  }
}

or use languages as array:, (*6)

personal_translations_widget:
  languages:
        en: English
        es: Spanish

Sonata Admin sample

protected function configureFormFields(FormMapper $form)
{
  $subject = $form->getAdmin()->getSubject();
  $form
    ->add('translations', 'translatable_field', array(
    'personal_translation' => 'Site\BaseBundle\Entity\AccommodationTranslation',
    'fields' => array('title', 'description', 'secondary_text'),
    'widgets' => array('title' => 'text', 'description' => 'textarea', 'secondary_text' => 'textarea'),
    'field_options'  => array('secondary_text' => array('attr' => array('class' => 'text-field')))
  ))
}

The Versions

28/06 2013

dev-master

9999999-dev https://github.com/usetwice/PersonalTranslationsWidget.git

Adds translations widget based on Personal translations

  Sources   Download

MIT

The Requires

 

by Alexander Murashov

translations twig form

09/12 2012

v0.2.2

0.2.2.0 https://github.com/rodgermd/PersonalTranslationsWidget.git

Adds translations widget based on Personal translations

  Sources   Download

MIT

The Requires

 

by Alexander Murashov

translations twig form

09/12 2012

v0.2.1

0.2.1.0 https://github.com/rodgermd/PersonalTranslationsWidget.git

Adds translations widget based on Personal translations

  Sources   Download

MIT

The Requires

 

by Alexander Murashov

translations twig form

09/12 2012

v0.2

0.2.0.0 https://github.com/rodgermd/PersonalTranslationsWidget.git

Adds translations widget based on Personal translations

  Sources   Download

MIT

The Requires

 

by Alexander Murashov

translations twig form

14/11 2012

v0.1

0.1.0.0 https://github.com/rodgermd/PersonalTranslationsWidget.git

Adds translations widget based on Personal translations

  Sources   Download

MIT

The Requires

 

by Alexander Murashov

translations twig form