eb78/custom-i18n-router-bundle

为Symfony定制的路由多语言支持

安装: 100

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 2

公开问题: 0

类型:symfony-bundle

0.2.0 2018-06-20 10:21 UTC

This package is auto-updated.

Last update: 2024-09-24 04:55:39 UTC


README

Build Status

CustomI18nRouterBundle

为Symfony设计的i18n包。

安装

使用Composer下载库

composer require eb78/custom-i18n-router-bundle

注册包

    ...
    new EB78\CustomI18nRouterBundle\EB78CustomI18nRouterBundle()
    ...

添加参数

    ...
parameters:
    available_locales: ['fr-fr']
    default_locale: 'fr-fr'
    ...

创建i18n配置文件。

例如,对于法语文件,创建一个名为"i18n_fr-fr"的文件,内容如下

( fr-fr 应包含在 available_locales 参数中 )

parameters:
    i18n_fr-fr:
        prefix: ""
        name: "france"
        localeUId: 1
        locale: "fr_FR"
        host: "yourdomain.fr"
        routes:
            home: /accueil/
            contact: /contactez-nous/

需求

  • PHP >= 7.x
  • Symfony 2.8