bushbaby / bsb-doctrine-translation-loader
BsbDoctrineTranslationLoader is a ZF2 module that provides a doctrine powered translation loader.
Requires
- php: >=5.3.3
- doctrine/doctrine-orm-module: >=0.7
- zendframework/zendframework: >=2.2.2
Requires (Dev)
- ext-sqlite3: ~0.7
- phpunit/phpunit: ~4.1
- squizlabs/php_codesniffer: ~2.0-RC
This package is auto-updated.
Last update: 2020-04-23 19:05:16 UTC
README
BsbDoctrineTranslationLoader is a small ZF2 module that provides a Doctrine based translation loader.
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.