how to add new languages ?

I want to add new languages , but how ?

  • See also

    If you want to add a new translation for a plugin (also including plugins bundled with Elgg) or the translation of Elgg core, copy the file en.php in the corresponding languages folder into a new file in the same directory. The name of your new language file should match the language code of the language you want to create a translation for (Elgg's main language file has a list of these codes at the bottom). Then just start to translate the language strings in your new language file (i.e. the strings to the left of => in the array in the file). If you come across a %s within a string, don't delete those. These are placeholders that will be replaced with a useful output on the site. If you remove a %s, there will be errors.

    The translations will only start to show up after flushing the site cache (in the admin section of your site). Or you could disable the caching during translating the language files to see the results immediately. Of course, you need to select this language to be used in the user settings of the user you are logged in (setting the site language in the admin section will only be used for new accounts that have not yet selected their own language in user settings).

    If you have a complete translation of the language files of Elgg core (or at least a significant amount), you can provide your translations at They will then be included in Elgg for the following releases, too.

  • so , if i want to add Hindi language , i just make new file hi.php in languages folder and Hindi language will be appear in languages selector (in user settings) ?

  • If you don't create a new (empty) hi.php file but copy+rename an existing language file (e.g. create a copy of en.php as hi.php) it's easier to translate (as you have the existing original language strings at hand). The new language (e.g. Hindi) should appear in the language selection if a corresponding language file exist (maybe not if the file is an empty file - therefore copy an existing file). It will not only appear in the user settings but also in the site language selection. But if you only change the site language your own existing account will not be using the new site language. This only happens if you select the language in the user settings.

    The completeness of the translation shown in the language selection (visible only when logged in as admin) will be quite low of course, if you haven't started to translate. Just give it a try and see how the completeness will increase the more you translate.

    Maybe another hint: save the modified language files with UTF8 encoding without Byte Order Marks (BOMs). The BOMs are invisible characters that will cause errors. Just use an editor that allows saving as text file in UTF8 encoding without BOMs.