Migration guide - Locale
Edit on GitHubThis migration guide is a part of the Silex migration effort.
To upgrade the module, do the following:
- Update the module using Composer:
composer update spryker/locale
- Add new plugins to dependency providers:
Zed integration
<?php
namespace Pyz\Zed\Application;
use Spryker\Zed\Application\ApplicationDependencyProvider as SprykerApplicationDependencyProvider;
use Spryker\Zed\Locale\Communication\Plugin\Application\LocaleApplicationPlugin;
class ApplicationDependencyProvider extends SprykerApplicationDependencyProvider
{
...
/**
* @return \Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface[]
*/
protected function getApplicationPlugins(): array
{
return [
...
new LocaleApplicationPlugin(),
...
];
}
...
}
Yves integration
<?php
namespace Pyz\Yves\ShopApplication;
use Spryker\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider;
use Spryker\Yves\Locale\Plugin\Application\LocaleApplicationPlugin;
class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider
{
...
/**
* @return \Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface[]
*/
protected function getApplicationPlugins(): array
{
return [
...
new LocaleApplicationPlugin(),
...
];
}
...
}
- Enable additional plugins:
EventDispatcher Zed integration
<?php
namespace Pyz\Zed\EventDispatcher;
use Spryker\Zed\EventDispatcher\EventDispatcherDependencyProvider as SprykerEventDispatcherDependencyProvider;
use Spryker\Zed\Locale\Communication\Plugin\EventDispatcher\LocaleEventDispatcherPlugin;
class EventDispatcherDependencyProvider extends SprykerEventDispatcherDependencyProvider
{
/**
* @return \Spryker\Shared\EventDispatcherExtension\Dependency\Plugin\EventDispatcherPluginInterface[]
*/
protected function getEventDispatcherPlugins(): array
{
return [
...
new LocaleEventDispatcherPlugin(),
...
];
}
}
EventDispatcher Yves integration
<?php
namespace Pyz\Yves\EventDispatcher;
use Spryker\Yves\EventDispatcher\EventDispatcherDependencyProvider as SprykerEventDispatcherDependencyProvider;
use Spryker\Yves\Locale\Plugin\EventDispatcher\LocaleEventDispatcherPlugin;
class EventDispatcherDependencyProvider extends SprykerEventDispatcherDependencyProvider
{
/**
* @return \Spryker\Shared\EventDispatcherExtension\Dependency\Plugin\EventDispatcherPluginInterface[]
*/
protected function getEventDispatcherPlugins(): array
{
return [
...
new LocaleEventDispatcherPlugin(),
...
];
}
}
Thank you!
For submitting the form