CodeIgniter Forums

Full Version: Creating multilanguage site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I'm familiar with lang helper and lang library, but I was wondering if there is a better way to do this. I don't really like the fact, that my views are a bunch of html code containing nothing but variables.

Is there a solution where a view would contain actual text and the CI would recognize that text when loading the view and changed the text according to user language setting? I know I could create multiple versions of the same view (one for every language), but that would mean making changes to the same html code in multiple places, which is again a bad idea.

Thank you!
No I'm sorry, you get the idea perfectly. You either use variables in your views so it's all dynamic, or use more static views. Personaly I use dynamic views with almost the full english words/sentices put in the language helper function. That helps making the view file more readable.
Hi.
You can try my library that uses PHP gttext may be it can help you

https://forum.codeigniter.com/thread-66236.html