Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

BsbDoctrineTranslationLoader is a small ZF2 module that provides a Doctrine based translation loader.

License

Notifications You must be signed in to change notification settings

bushbaby/BsbDoctrineTranslationLoader

Repository files navigation

BsbDoctrineTranslationLoader

BsbDoctrineTranslationLoader is a small ZF2 module that provides a Doctrine based translation loader.

Latest Stable Version Total Downloads Latest Unstable Version License

Build Status Code Coverage Scrutinizer Code Quality Build Status Dependency Status

Installation

php composer.phar require "bushbaby/bsb-doctrine-translation-loader:~1.0"

Then add BsbDoctrineTranslationLoader to the config/application.config.php modules list.

Copy the config/bsb_doctrine_translation_loader.global.php.dist to the config/autoload directory to jump start configuration.

Create the required database tables by importing running;

mysql database < etc/mysql.sql

Requirements

  • >=PHP5.3
  • >=ZF2.2.2

Configuration

To configure the module just copy the bsb_doctrine_translation_loader.global.php.dist (you can find this file in the config folder of BsbDoctrineTranslationLoader) into your config/autoload folder, and override what you want.

To enable the loader for a particular text domain add a remote.

return array(
    'translator' => array(
        'remote_translation' => array(
            /* add a remote translation loader for each text domain */
            // array('type' => 'BsbDoctrineTranslationLoader', 'text_domain' => 'default'),
            // array('type' => 'BsbDoctrineTranslationLoader', 'text_domain' => 'other'),
        ),
    ),
);

Change the connection

By default BsbDoctrineTranslationLoader will use the orm_default connection which is configured by DoctrineORMModule. If you need to change the connection, change the 'entity_manager' key;

return array(
    'bsb_doctrine_translation_loader' => array(
        'entity_manager' => 'em_identifier',
    ),
);

Note: that is up to you to configure the DoctrineORMModule such that 'em_identifier' exists as a valid connection.

About

BsbDoctrineTranslationLoader is a small ZF2 module that provides a Doctrine based translation loader.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages