Skip to content

Commit

Permalink
Merge pull request #57 from froschdesign/hotfix/docs/servicemanager
Browse files Browse the repository at this point in the history
Adds missing installation requirements for translator and updates descriptions for suggested packages in Composer config file
  • Loading branch information
froschdesign authored Oct 13, 2021
2 parents 49f279d + 946d50f commit 563b1b7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
"phpspec/prophecy": "<1.9.0"
},
"suggest": {
"laminas/laminas-cache": "Laminas\\Cache component",
"laminas/laminas-config": "Laminas\\Config component",
"laminas/laminas-cache": "You should install this package to cache the translations",
"laminas/laminas-config": "You should install this package to use the INI translation format",
"laminas/laminas-eventmanager": "You should install this package to use the events in the translator",
"laminas/laminas-filter": "You should install this package to use the provided filters",
"laminas/laminas-i18n-resources": "Translation resources",
"laminas/laminas-servicemanager": "Laminas\\ServiceManager component",
"laminas/laminas-i18n-resources": "This package provides validator and captcha translations",
"laminas/laminas-servicemanager": "You should install this package to use the translator",
"laminas/laminas-validator": "You should install this package to use the provided validators",
"laminas/laminas-view": "You should install this package to use the provided view helpers"
},
Expand Down
17 changes: 17 additions & 0 deletions docs/book/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ The translator itself is initialized without any parameters, as any
configuration to it is optional. A translator without any translations will do
nothing but return all messages verbatim.

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation Requirements
>
> The translation support of laminas-i18n depends on the [laminas-servicemanager](https://docs.laminas.dev/laminas-servicemanager/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-servicemanager
> ```
## Adding translations
Two options exist for adding translations to the translator:
Expand Down Expand Up @@ -74,6 +83,14 @@ Additionally, you can use custom formats by implementing one or more of
`Laminas\I18n\Translator\Loader\RemoteLoaderInterface`, and registering your loader
with the `Translator` instance's composed plugin manager.

> ### Installation Requirements
>
> The support of the INI translation format depends on the [laminas-config](https://docs.laminas.dev/laminas-config/) component, so be sure to have it installed before getting started:
>
> ```bash
> $ composer require laminas/laminas-config
> ```
## Setting a locale
By default, the translator will get the locale to use from ext/intl's `Locale`
Expand Down

0 comments on commit 563b1b7

Please sign in to comment.