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..
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..
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:
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');