I have a Zend Framework site that setups all routes in a file, routes.ini. The routes look like this:
routes.popular.route = popular/:type/:page/:sortOrder
routes.popular.defaults.controller = popular
routes.popular.defaults.action = index
routes.popular.defaults.type = images
routes.popular.defaults.sortOrder = alltime
routes.popular.defaults.page = 1
routes.popular.reqs.type = \w+
routes.popular.reqs.page = \d+
routes.popular.reqs.sortOrder = \w+
In bootstrap.php they are read and added to the frontController:
$config = new Zend_Config_Ini(APPLICATION_PATH . ‘/config/routes.ini’);
$router = $frontController->getRouter();
$router->addConfig($config,‘routes’);
I would like to add localization to the URL, for example www.mysite.com/en/popular, www.mysite.com/sv/popular. What is the preferred way of doing this?