My Account

What's New

PHPMembers Blog

Who's Online

We have 233 guests and 3 members online

 

How to translate the system into your own language PDF Print E-mail
To translate the system into your own language, you need to create a language file, template files of the language and add the language to the configuration file.

Language file

Each language has a language file in /languages folder. The file is a PHP script named as the language ID. Inside the file, there is an array contains all the text that are displayed in the system. For example, eng.php is the language file of English. Open the file you can see the following lines.

'id' => 'eng',
'name' => 'English',
'timeFormat' => 'M j Y H:i:s',


Each language must have a unique language ID in the system. The first line defines the language ID of the language. The ID helps the system to identify the language from other languages. The language file must be named after it.

The second line is the name of the language. It is shown on the language dropdown menu.

The last line is the time format of the language. When the system displays a time, it is applied.

The rest elements of the array are text shown by the system.

Template files

Each language has its own template files in /templates folder. The template files include at least one web template file, four email template files and a template file for the block in the user panel homepage. All template files are stored in a folder name after the language ID.

To learn more about how to modify these template files, please see Customized Styles category.

Adding the language to the system configuration file

To add the language to the system, you must modify the configuration file /lib/config.inc.php.

The file contains an array defines all the available languages in the system. It looks like the following codes.

$cfg['language'] = 'eng';
$cfg['languages']['0']['id'] = 'eng';
$cfg['languages']['0']['display'] = 'English';
$cfg['languages']['1']['id'] = 'simp_cn';
$cfg['languages']['1']['display'] = 'Chinese';


For example, you would like to add Spanish to the system, and you have defined the language ID as “es”. The following two lines are able to do that.

$cfg['languages']['2']['id'] = 'es';
$cfg['languages']['2']['display'] = 'Spanish';