Developed with love by KnpLabs Hire us for your project!
148

LocaleBundle

by lunetics

Locale Bundle for symfony2

LuneticsLocaleBundle

This bundle allows you to guess the Locale from different parameters in your Symfony2 applications.

Build Status

Background

The locale can be guessed from different parameters in your applications :

  • In the Query parameter
  • In the Route parameters
  • In the Browser preferences
  • In a Cookie or the Session if the locale has already been identified
  • Based on the Subdomain hostname

Documentation

Read the Documentation for master

Read the Documentation for 2.1

License

This bundle is released under the MIT License

Authors

Matthias Breddin : @lunetics

Christophe Willemsen : @kwattro

lunetics_locale:
strict_mode: false
strict_match: false
disable_vary_header: false
allowed_locales: []
guessing_excluded_pattern: ~
guessing_order: [] # Required
router_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\RouterLocaleGuesser
browser_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\BrowserLocaleGuesser
cookie_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\CookieLocaleGuesser
session_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\SessionLocaleGuesser
query_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\QueryLocaleGuesser
subdomain_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\SubdomainLocaleGuesser
topleveldomain_guesser:
class: Lunetics\LocaleBundle\LocaleGuesser\TopleveldomainLocaleGuesser
cookie:
set_on_change: true
class: Lunetics\LocaleBundle\Cookie\LocaleCookie
name: lunetics_locale
ttl: 86400
path: /
domain: ~
secure: false
httpOnly: true
session:
variable: lunetics_locale
query:
parameter_name: _locale
subdomain:
region_separator: _
topleveldomain:
locale_map:

# Prototype
name: []
form:
languages_only: true
strict_mode: false
switcher:
template: links
show_current_locale: false
redirect_to_route: ~
redirect_statuscode: 302
use_controller: false
use_referrer: true
  • Merge pull request #142 from coudenysj/feature/domain-locale-guesser
    By lunetics, 2 years ago
  • #141: Add support for domain names with a dash
    By coudenysj, 2 years ago
  • #141: Add the DomainLocaleGuesser (based on the topleveldomain guesser)
    By coudenysj, 2 years ago
  • #141: Add some documentation about the new domain guesser
    By coudenysj, 2 years ago
  • Merge pull request #138 from EmmanuelVella/_route
    By lunetics, 2 years ago
  • Test if route is not empty
    By emmanuelvella, 2 years ago
  • Merge pull request #137 from lunetics/keep-query-string
    By dbu, 2 years ago
  • keep query string when redirecting
    By dbu, 2 years ago
  • Merge pull request #134 from nurikabe/master
    By dbu, 2 years ago
  • Revert to backwards-compatible test
    By nurikabe, 2 years ago
  • Use master request when RequestStack available
    By nurikabe, 2 years ago
  • Merge pull request #132 from nurikabe/master
    By lunetics, 2 years ago
  • Get tests to pass again. Ignore ICU failures in Symfony 2.4 builds.
    By nurikabe, 2 years ago
  • Merge pull request #131 from nurikabe/patch-2
    By dbu, 2 years ago
  • Update Travis build status image
    By nurikabe, 2 years ago
  • Merge pull request #130 from saidul/issue_129
    By dbu, 2 years ago
  • Fixed #129
    By saidul, 2 years ago
  • Merge pull request #117 from ivoba/master
    By dbu, 2 years ago
  • added localhost as host in test
    By ivoba, 2 years ago
  • emptied default map, improved docs, fixed tests
    By ivoba, 2 years ago
  • cleaned up configuration
    By ivoba, 2 years ago
  • Merge pull request #121 from EmmanuelVella/patch-3
    By dbu, 2 years ago
  • Initialize arrays in LocaleGuesserManager
    By emmanuelvella, 2 years ago
  • Merge pull request #120 from EmmanuelVella/patch-2
    By lsmith77, 2 years ago
  • Coding convention update
    By emmanuelvella, 2 years ago
  • Merge pull request #119 from goetas/patch-1
    By lunetics, 2 years ago
  • Added PHP 5.6 to travis
    By goetas, 2 years ago
  • added topleveldomain guesser
    By ivoba, 2 years ago
  • Merge pull request #115 from EmmanuelVella/locale-listener
    By lunetics, 2 years ago
  • Merge pull request #112 from WouterJ/patch-1
    By lunetics, 2 years ago