$L = LBSystem::readlanguage($langfile);
Returns the appropriate user language as an array.
Reads the language from language specific language files.
Your plugin filesystem should look like:
For this files, your $langfile parameter needs to be:
Your language files are searched in
The function appends the user language before of the dot in language.ini (language_en, langauge_de, language_cz and so on).
It reads both the users language and the English (fallback) language. If any phrase is missing in the user language, the English phase is taken.
The function returns an $array with keys. The key is assembled from the section and the tag of the language file in the form:
You can access every phrase using
Your language file for this example should look like this:
The language files need to be encoded in UTF-8 without BOM. Line endings need to be Unix LF.
Special features for LoxBerry-Core developers
You won't need this as a plugin developer.
This will read the system language to
$SL (access by
function readlanguage($template = NULL, $genericlangfile = "language.ini", $syslang = FALSE)
$template is a LBTemplate object - the language is directly sent to this template.
$syslang = True reads the LBSTEMPLATEDIR/lang/language.ini. The $genericlangfile parameter is ignored in that case. The parameter is used in head and pagestart as also for plugins we need to force the system language for the LB templates.