inspiredminds/contao-remember-language
Composer 安装命令:
composer require inspiredminds/contao-remember-language
包简介
Contao 4 extension to redirect to a language saved in a cookie.
README 文档
README
Contao Remember Language
Contao 4 extension to redirect to a language saved in a cookie when using contao.prepend_locale: true and requesting the domain without any language parameter in the URL.
Configuration
The extension allows you to configure the following:
- Enable or disable the redirect.
- Enable or disable saving the current language in a cookie.
- The name of the cookie.
# Default configuration for extension with alias: "contao_remember_language" contao_remember_language: # Enables the automatic redirect to the saved language. enable_redirect: true # Saves the current language as a cookie. save_language: true # Name of the cookie where the language is saved. cookie_name: contao_remember_language
Caching
If you use caching, make sure to not add the configured cookie to your COOKIE_ALLOWLIST. The information of the cookie is only relevant for requests to https://example.org/ (without any path/parameter), and since Contao (at least up to Contao 4.9) always redirects such requests (with a status code other than 301) when using contao.prepend_locale: true, such requests are never cached. Thus, it is not necessary to prevent caching when the request contains the cookie.
统计信息
- 总下载量: 151
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2018-01-19