Multilingual support using gettext with codeigniter, best practice?

Posted by tobefound on Stack Overflow See other posts from Stack Overflow or by tobefound
Published on 2010-03-26T22:07:23Z Indexed on 2010/06/10 23:12 UTC
Read the original article Hit count: 410

Filed under:
|
|
|

I know how to create .po files and how to generate .mo files and then use them for translation on my Codeigniter powered site. However, I'm not quite sure on how to change language from the site GUI. I want to stick to codeigniter's default url calling schema: www.domain.com/controllername/method/param1/param2.

Calling the server like this is a no-brainer: www.domain.com/controllername?lang=en

Doing that for every controller using the default url schema, requires me to implement the same method in every controller, just to pass the lang parameter to the setlocale() function and then bind to my .po domain name. Feels awkward...

ANy ideas how you guys work with gettext in codeigniter? And yes, I do want to work with gettext.

© Stack Overflow or respective owner

Related posts about php

Related posts about codeigniter