Using the @Route annotation in Symfony I can do the following:
/**
* @Route({
* "en": "/{_locale}/registration",
* "de": "/{_locale}/registrierung",
* },
* name="registration",
* defaults={
* "_locale":"%kernel.default_locale%"
* },
* requirements={
* "_locale":"^[a-z]{2}?$"
* })
*/
public function defaultAction() { }
Visitors with english language can call www.mysite.com/en/registration and visitors with german language can call www.mysite.com/de/registrierung then.
Is it possible to declare a default for languages not explicitly declared? Such that a route for e.g. es or fr visitors works like www.mysite.com/es/reg or www.mysite.com/fr/reg?
Pseudo-Code:
/**
* @Route({
* "en": "/{_locale}/registration",
* "de": "/{_locale}/registrierung",
* "_default_": /{_locale}/reg"
* },
* name="registration",
* defaults={
* "_locale":"%kernel.default_locale%"
* },
* requirements={
* "_locale":"^[a-z]{2}?$"
* })
*/
public function defaultAction() { }