Adding new languages to your site: Revision

Last updated by Trajan

Adding a language to your site is very simple to do. JeanBS explained roughly how to do it. Here is some further detail.

Basics

Elgg deals in language files. Go to your root folder and you will find a languages folder. Open that and you'll find a 'en.php'. Open that in a text editor (I don't recommend notepad for this) and you'll see the layout of a language file. 

To alter the language all you need to do is change the following:

$english = array(

add_translation("en",$english);

to

 

$bengali = array(

add_translation("bn",$bengali);

 

Then simply edit the following text:

 

'login' => "Log in",

'loginok' => "You have been logged in.",

 

to

 

'login' => "blahblahblah",

'loginok' => "something.",

Remember to save as otherwise you will overwrite your en.php file.

Further

Every plugin (usually) has its own language file. You can find this out by going into the root folder of that plugin and seeing if there is a language folder. Open it up and check what you've got inside. Do the same operation as mentioned above in basics. 

Saving - Important

When you save a language file that's not en.php it must be encoded properly. (Notepad can't manage this easily). It must be encoded as UTF_8(w/o BOM). If you don't do this then you'll get a lot of question marks where you language should be.

Recommended Editor

I use this editor to do my work as it's very simple, clever and open source!

Good luck. 

History