hkulekci/translation-component

Zend Expressive 翻译组件 - 注意:目前仅支持与 twig 一起使用

dev-master 2018-12-06 12:40 UTC

This package is auto-updated.

Last update: 2024-09-07 12:35:01 UTC


README

使用 composer 进行安装

composer require hkulekci/translation-component

并将 \TranslationComponent\ModuleConfig::class 添加到您的 config.php 文件中。

此库中有一个控制台界面。您可以使用 bin/console 命令检查命令,或者您可以将它与您的控制台界面集成。要做到这一点,请查看 src/config/module.config.php 配置文件。

有一个页面处理器(\TranslationComponent\Handler\LocaleChangePageHandler)用于在会话中更改语言。我们已经为这个目的创建了一个路由。我们在应用程序中使用会话来处理语言。另外,还有一个 RequestHeader 处理器。在未来,我们将添加一些其他处理器,如 path

另一方面,我们有一些中间件用于处理将翻译文件导入应用程序。请查看 \TranslationComponent\Middleware\TranslationMiddleware 类。

最后,目前我们只支持 twig。不支持其他类型的渲染器用于 Zend Expressive。