Archive for the ‘i18n’ tag
A straightforward way to translate your language files in CodeIgniter
Months ago we discussed about different alternatives to add i18n support to CodeIgniter applications. On this opportunity we will show how easy is to maintain your language files using CodeIgniter Language File Translator by MrKirkland and Owen Christian.
Basically what you need to do is download the zip here and then unpack the files under appropriate location, as explained in the article.
CodeIgniter in Spanish Language
CodeIgniter has been translated to many international languages, not only the User Guide but also the messages and errors strings in its language packs.
For example, you can find Spanish translations for your CodeIgniter applications, here. [Make sure to download the right version, ie: 1.7.2]
Internationalization i18n in CodeIgniter
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.





