0

I need create a website which should available to the users in Hindi as well as in English.

Any suggestions?

EDIT

When I try to save hindi_lang.php it's not saving just giving unicode error..

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • 1
    [Have](http://codeigniter.com/user_guide/libraries/language.html) [you](http://stackoverflow.com/questions/6112132/how-to-setup-codeigniter-for-a-truly-multi-language-website) [read](https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n) [these](http://stackoverflow.com/questions/1291318/internationalization-on-codeigniter-config-files)? – Kemal Fadillah Sep 24 '12 at 11:46

2 Answers2

0

Well, CodeIgniter has a nifty class called Language. You can create language files for hindi and store it in a folder system/language/hindi

At the cost of repeating what the documentation says:

Creating Language Files

Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file containing error messages. You might name it: error_lang.php

Within the file you will assign each line of text to an array called $lang with this prototype:

$lang['language_key'] = "The actual message to be shown";

Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

$lang['error_email_missing'] = "You must submit an email address";
$lang['error_url_missing'] = "You must submit a URL";
$lang['error_username_missing'] = "You must submit a username";

You then load the language file like you load anything else in CI, $this->lang->load('filename', 'language');

automaticAllDramatic
  • 2,025
  • 1
  • 21
  • 25
0

Use the i18n library with hindi unicodes.

Arun David
  • 2,714
  • 3
  • 18
  • 18