Chamilo
Search…
Language variables
Plugins can also use the global get_lang() function available inside the rest of the code of Chamilo, but they have to use a variation : get_plugin_lang(), that requires you to give the name of the plugin in which it is used.
Language variables have to be located in a lang/[language].php file. E.g, the basic plugin language file for plugin « abc » will reside inside the plugin's subfolder « lang »: /plugin/abc/lang/english.php
The file itself has to use the following format :
1
/* Plugin's language variables */
2
3
$strings['plugin_title'] = 'ABC';
4
$strings['plugin_comment'] = 'Plugin for managing the … website';
5
$strings['SelectASession'] = 'Select a session';
Copied!
As you can see, the format has to be set as an array called « $strings ».
The two first array elements are mandatory. They will allow administrators to see the plugin name and a short description in their own language.
To use the variables from inside the plugin, inside a template file (.tpl)... (to be completed)
Export as PDF
Copy link