1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-multilang.git synced 2024-04-24 21:29:30 +03:00

Bug in Readme.md

This commit is contained in:
Hamlet 2013-06-27 10:30:38 -07:00
parent d4e7d8d246
commit c754d49fed

View file

@ -55,15 +55,15 @@ If you try to access `http://www.domain.tld/`, the module will redirect it to `h
Let's say we have a product page, with kohana 3 we'd have something like :
Route::set('product.details', 'products/<product_id>-<product_slug>', array(
'product_id' => '[0-9]+',
'product_slug' => '.+',
))->defaults(array(
'controller' => 'Product',
'action' => 'details',
'product_id' => NULL,
'product_slug' => '',
));
Route::set('product.details', 'products/<product_id>-<product_slug>', array(
'product_id' => '[0-9]+',
'product_slug' => '.+',
))->defaults(array(
'controller' => 'Product',
'action' => 'details',
'product_id' => NULL,
'product_slug' => '',
));
@ -118,4 +118,4 @@ If you have any suggestions, found a bug or anything, feel free to share.
We change the Request to force the detection of a language on the site root. Then if a route is found, we get the language from it with its 'lang' parameter and we initialize.
Each route created with a language code gets another parameter: `lang`. A uri like `products/details` will become `<lang>/products/details`.
But since every multilingual route is unique (except default), the regex part allows only one language code. So we have `array('lang' => 'en')` instead of having something like `array('lang' => '(en|fr|de')`. We could have directly the language code in the uri like `en/products/details` but the lang parameter allows us to easily retrieve the route language and works better with the default route.
But since every multilingual route is unique (except default), the regex part allows only one language code. So we have `array('lang' => 'en')` instead of having something like `array('lang' => '(en|fr|de')`. We could have directly the language code in the uri like `en/products/details` but the lang parameter allows us to easily retrieve the route language and works better with the default route.