Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup CodeIgniter for a truly multi language website?

I need to setup CodeIgniter to be a truly multi language website. I've searched but I can't find a solution.

I've tested this approach but it is not working. (http://codeigniter.com/wiki/Category%3AInternationalization%3A%3AInternationalization_Views_i18n/)

Can someone give me a clue about what setup to use to get a truly multi language environment in CodeIgniter?

Best Regards,

like image 881
André Avatar asked May 24 '11 14:05

André


People also ask

How can I have multiple languages for my website?

There are two ways you can build a multilingual website: through a subdomain approach or a separate domain approach. That means you can either have a single website domain with other-language linked pages or use separate domains to host the multilingual versions of your content.

Which language is used in CodeIgniter?

CodeIgniter is the best framework that is used today for the PHP language.


1 Answers

https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n

If you implement this, you URLs will contain the language code. You can save your language parts in the language directory. With the function lang();

Loading language files and handling them is explained here: https://www.codeigniter.com/user_guide/libraries/language.html

The helper: https://www.codeigniter.com/user_guide/helpers/language_helper.html

Easiest way is have to some global language files which you auto load. I suggest creating a language file for every controller. So you only load the part you need instead of loading all language files.

like image 160
P.T. Avatar answered Sep 23 '22 06:09

P.T.