Download the PHP package argentum/translation-bundle without Composer
On this page you can find all versions of the php package argentum/translation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download argentum/translation-bundle
More information about argentum/translation-bundle
Files in argentum/translation-bundle
Package translation-bundle
Short Description Provides a database storage for translations and GUI for editing them
License MIT
Homepage http://argentum.ua
Informations about the package translation-bundle
ArgentumTranslationBundle
ArgentumTranslationBundle provides a database storage for translations and GUI for editing them.
This bundle supports PHP 5.4+ and Symfony 2.3+.
The bundle combines the power of the following bundles:
Installation
Install the bundle with composer:
Register the bundle in :
Configuration
In the you should configure a list of locales:
Then in the you should add the following options:
Make sure you have registered KnpLabs DoctrineBehaviors Listeners in your :
and have registered A2lixTranslationFormBundle in :
And finally, create translation tables in your database:
or create a migration and execute it:
Translation editor
Now you can use GUI for editing the translations.
The bundle will automatically add additional items in the menu of your Sonata Admin. If you have customized the menu, you should add Translation group in :
The list of all domains is located at URL something like (depends on the base location of Sonata Admin in your project): .
Loading order
When merging all translations together translations from files in all bundles will be loaded, and then all translations from the database will be loaded. Thus, translations from the database can override any translation from the translation files in your project.
Proposed workflow
Firstly, when developing your project you should use admin panel to create all necessary domains and add all necessary translations to them.
Secondly, when your bundle is ready, you should export all translations for the bundle domain into the bundle translation files and commit them to VCS.
And finally, when your project is started, you or your client can edit any translation without need to edit project files.
Cache
All translations are cached in the cache files and will be loaded from the database only once after clearing the cache.
Export
This bundle allows you to export translations from the database for single domain or all domains in the specified directory for the specified locales using the specified format.
Export all translations to the directory:
Export translations for domain "messages":
Export translations for domain "messages" and locales "ru" and "uk" in xliff format:
Import
This bundle allows you to import translations from files into the database.
Import all translations from the specified directory:
Import translations from the directory only for the domain "messages":
Import translations from the directory only for the domain "messages" and locales "ru" and "uk":
Import translations from the specified bundles:
Import translations from the entire project including all bundles, Form and Validation components, and local application translations:
All versions of translation-bundle with dependencies
symfony/symfony Version >=2.3
symfony/monolog-bundle Version >=2.3
twig/twig Version >=1.10
doctrine/common Version >=2.2
doctrine/orm Version >=2.2
knplabs/doctrine-behaviors Version >=1.0
a2lix/translation-form-bundle Version >=2.0
sonata-project/admin-bundle Version >=2.0
sonata-project/doctrine-orm-admin-bundle Version >=2.2