CodeIgniter Forums
Controller Language Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Controller Language Problem (/showthread.php?tid=26215)



Controller Language Problem - El Forum - 01-08-2010

[eluser]webroasters[/eluser]
Hey Guys,

I'm not new to CI, but I'm new the forums. I have a quick question. CI is great when it comes to languages, but I was wondering if you guys had any suggestions on how to deal with controller names in other languages. For example, in Spanish, the word page is "Pagina". How would I switch that if I had a url like this: "http://www.example.com/pages/", and I wanted a url like: "http://www.example.com/paginas/"??

EDIT: When I mean switch, I mean on a language level, not on a physical controller name level.

Thanks guys.


Controller Language Problem - El Forum - 01-08-2010

[eluser]SpooF[/eluser]
http://ellislab.com/codeigniter/user-guide/general/routing.html
Code:
$route['page/(:num)'] = "page/$1";
$route['pagina/(:num)'] = "page/$1";

Hope that solves your problem.


Controller Language Problem - El Forum - 01-08-2010

[eluser]webroasters[/eluser]
Ah, I didn't think of dealing with the router file. Nice one. That's brillant. I should have thought of that. Thanks man.