Skip to content

Commit 5ea4e35

Browse files
author
Andrew Zhdanovskih
committed
Update README
1 parent 6c2be14 commit 5ea4e35

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ Sometimes You have to give the visual interface of i18n message CRUD for a custo
44

55
With this bundle i18n messages stored in a database instead of files, then, you can implement web-interface to manage it.
66

7+
## Installation
8+
9+
```bash
10+
composer require creative/symfony-db-i18n-bundle
11+
```
12+
13+
Bundle **has not** (yet) a flex auto-configurator. Add
14+
15+
```php
16+
Creative\DbI18nBundle\DbI18nBundle::class => ['all' => true],
17+
```
18+
19+
to you `config/bundles.php` file, and (optional) place the `db_i18n.yaml` with configuration (see below) file to your config directory.
20+
721
## Some rules:
822

923
- you application service container must have aa array `locales` parameter with possible application locales. For example:
@@ -29,3 +43,18 @@ bin/console creative:db-i18n:migrate translations/messages.en.yaml
2943
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>`.
3044

3145
After (or instead of) that, make your forms/interfaces and add, change and so on with your messages.
46+
47+
## Defaults
48+
49+
Default config is
50+
51+
```yaml
52+
# src/Resources/config/db_i18n.yaml
53+
db_i18n:
54+
entity: Creative\DbI18nBundle\Entity\Translation
55+
domain: db_messages
56+
```
57+
58+
Copy this wherever you want and modify.
59+
60+
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.

0 commit comments

Comments
 (0)