Posts Tagged ‘resources’

Internationalization i18n in CodeIgniter

Posted in Tutorials on July 16th, 2009 by admin – 1 Comment

Developing web applications with i18n support is easier with the help of a PHP framework. CodeIgniter has many libraries and helpers that makes the life easier for developers that require i18n support in their applications.

Here are some libraries and articles that may help you to figure how to create i18n web applications:

Using the Language Class & Helper

The Language class provided in CodeIgniter may be the first place to check out. It supports an easy way load language files.

In addition, the Language helper assists you while working with language files. It simply provides a lang() helper function instead of calling $this->lang->item() each time.

I’d strongly recommend the Internationalization Views i18n Wiki page. That article will guide you how to add i18n support in views, controllers and configuration files. You can also review the Internationalization category in that Wiki in order to find more information regarding to i18n approaches.

Using a library

Internationalization (i18n) library for CodeIgniter is a library that makes possible to easily change between languages by adding the language code in the URL.

For example, you may be able to use the following URL to switch between languages:

  • domain.com/en/controller
  • domain.com/fr/controller

The following diagram (taken from Maestric website) illustrates the way this library works.

Related searches:

  • codeigniter internationalization
  • codeigniter i18n
  • i18n codeigniter
  • Internationalisation codeigniter
  • codeigniter internationalisation
  • Internationalization (i18n) library for CodeIgniter
  • i18n en codeigniter
  • i18n for codeigniter
  • internationalization codeigniter
  • switch between different languages in url codeigniter