Language files

The language files are stored in the lang/ directories. These are PHP files named with a prefix and a language code: prefix_xx.php.

Content of the files

These PHP files each declares a mapping table. Each key has its corresponding value. Any and all problematic language characters are transcribed using the HTML entities (for accented letters, for example), and some languages have the values written in unicode html entities (e.g. for Japanese, Arabic, etc.).

<?php
$GLOBALS[$GLOBALS['idx_lang']] = array(
	'key' => 'value',
	'key2' => 'value2',
	// ...
);

Example

Here is an extract from the French language file for the template of this site
(documentation_fr.php):

<?php
$GLOBALS[$GLOBALS['idx_lang']] = array(
	//C
	'choisir'=>'Choisir...',
	'conception_graphique_par'=>'Th&egrave;me graphique adapt&eacute; de ',
	//E
	'en_savoir_plus' => 'En savoir plus !',
	//...
);

The equivalent extract from the English version (documentation_en.php)would look like this:

<?php
$GLOBALS[$GLOBALS['idx_lang']] = array(
	//C
	'choisir'=>'Select...',
	'conception_graphique_par'=>'Graphical theme based on ',
	//E
	'en_savoir_plus' => 'Find out more!',
	//...
);

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français