Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 9ecef22

Browse files
committed
Added documentation for i18n migration
1 parent d57f037 commit 9ecef22

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/book/migration/to-v3-0.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,41 @@ ensure console tooling continues to work.
7878
> [zf-console](https://github.com/zfcampus/zf-console) or
7979
> [Aura.Cli](https://github.com/auraphp/Aura.Cli).
8080
81+
## i18n integration
82+
83+
Internationalization tooling, including:
84+
85+
- the integration translator (`MvcTranslator` service)
86+
- the "dummy" translator
87+
- the `TranslatorAwareTreeRouteStack` implementation
88+
- factories for the translator and translator loader managers
89+
90+
were removed, and re-assigned to the [zend-i18n](https://zendframework.github.io/zend-i18n/)
91+
and [zend-mvc-i18n](https://zendframework.github.io/zend-mvc-i18n/) packages.
92+
In most cases, you can install `zendframework/zend-mvc-i18n` to restore i18n
93+
functionality to your application:
94+
95+
```bash
96+
$ composer require zendframework/zend-mvc-i18n
97+
```
98+
99+
There are two categories of changes that could affect you on upgrading.
100+
101+
First, if you were using the `TranslatorAwareTreeRouteStack`, the class name has
102+
changed from `Zend\Mvc\Router\Http\TranslatorAwareTreeRouteStack` to
103+
`Zend\Mvc\I18n\Router\TranslatorAwareTreeRouteStack`; updating your code to
104+
reflect that will allow it to work again.
105+
106+
Second, if you were extending one of the service factories for either the
107+
`MvcTranslator` or the `TranslatorPluginManager`, the namespaces for the
108+
factories have changed. In such situations, you have two options:
109+
110+
- Update your extensions to extend the new classes. See the [zend-mvc-i18n
111+
migration guide](https://zendframework.github.io/zend-mvc-i18n/migration/v2-to-v3/)
112+
to determine what names have changed.
113+
- Instead of extending, consider using [delegator factories](https://zendframework.github.io/zend-servicemanager/delegators/),
114+
as these decorate the service factory, regardless of what factory is used.
115+
81116
## Plugins
82117

83118
The following plugins have been removed from the main zend-mvc repository, and

0 commit comments

Comments
 (0)