Download the PHP package creative/symfony-db-i18n-bundle without Composer
On this page you can find all versions of the php package creative/symfony-db-i18n-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creative/symfony-db-i18n-bundle
More information about creative/symfony-db-i18n-bundle
Files in creative/symfony-db-i18n-bundle
Package symfony-db-i18n-bundle
Short Description Allow store i18n-messages in database
License MIT
Informations about the package symfony-db-i18n-bundle
Sometimes You have to give the visual interface of i18n message CRUD for a customer. To do this, You need to have storage, which is not under version control and allowed from a form.
I18n messages stored in database
With this bundle i18n messages stored in a database instead of files, then, you can implement web-interface to manage it.
Installation
Bundle has not (yet) a flex auto-configurator. Add
to you config/bundles.php
file, and (optional) place the db_i18n.yaml
with configuration (see below) file to your config directory.
Some rules:
-
you application service container must have aa array
locales
parameter with possible application locales. For example: - implementation of
Symfony\Contracts\Translation\TranslatorInterface
must have agetCatalogue
method (usually, it have) for import messages from translation files to database. -
You must define the default messages domain as
db_messages
in you views to use messages from database. For example: - update you database schema after install this bundle — use
bin/console doctrine:schema:update
command or make migration for this.
So, now you can load messages from old translation files to the database. Command
will import all messages from [project root]/translations/messages.en.yaml
. You can set absolute path instead, nevermind, but file name must be compatible with Symfony localization files agreement — <domain>.<locale>.<format>
.
After (or instead of) that, make your forms/interfaces and add, change and so on with your messages.
Defaults
Default config is
Copy this wherever you want and modify.
As you can see, the default messages domain is db_messages
. If you want to override this and store default Symfony domain messages
in a database, don't forget to remove (or rename) you translations/messages.<locale>.[yaml|csv|xlf]
file.
All versions of symfony-db-i18n-bundle with dependencies
doctrine/common Version ^2.12|^3.1
doctrine/doctrine-bundle Version ^1.8|^2.0
doctrine/orm Version ^2.7
doctrine/persistence Version ^2
ramsey/uuid Version ^3.8|^4
ramsey/uuid-doctrine Version ^1.5
symfony/config Version ^4.1|^5
symfony/dependency-injection Version ^4.1|^5
symfony/doctrine-bridge Version ^4.1|^5
symfony/finder Version ^4.1|^5
symfony/framework-bundle Version ^4.1|^5
symfony/polyfill-mbstring Version *
symfony/translation Version ^4.1|^5
symfony/twig-bridge Version ^4.1|^5
symfony/twig-bundle Version ^4.1|^5
twig/twig Version ^2.4|^3
symfony/yaml Version ^4.1|^5