wegmeister/language-redirect

一个基于浏览器语言的Neos CMS语言重定向包。

1.0.0 2023-11-28 16:58 UTC

This package is auto-updated.

Last update: 2024-08-28 18:41:52 UTC


README

本包为Neos CMS提供简单的语言检测服务,将用户重定向到与他们的Accept-Language头部最匹配的语言版本。仅在uri路径为空(例如/)时进行重定向。

安装

在你的网站包中运行以下命令

composer require --no-update wegmeister/language-redirect

然后在项目根目录下运行 composer update

配置

有时语言代码配置与Neos不同。因此,你可以在你的Settings.yaml中配置映射。

Wegmeister:
  LanguageRedirect:
    # Add mappings for language codes if you use some different codes than the default ones.
    languageCodeOverrides:
      # For example, if you use "cz" instead of "cs" for Czech, you can add this mapping:
      cs: cz