Bitrix Site Manager

IncludeTemplateLangFile

IncludeTemplateLangFile(
 string abs_path,
 string lang = false
)

The function IncludeTemplateLangFile includes a language file into scripts which are located in the current site template folder. This function is usually used with components, or the site prologue or epilogue.

The function searches for the language file in the following locations.

  1. First, the language file is presumed to be stored in the folder:

    /bitrix/templates/current site template ID/lang/language ID/relative path to script

  2. If the file is not found, the function tries the following folder:

    /bitrix/templates/.default/lang/language ID/relative path to script

  3. If the file is still not found, the module installation folder is searched:

    /bitrix/modules/module ID/install/templates/lang/language ID/relative path to script

Commonly, a "relative path to script" is the path to file relative to folder /bitrix/templates/current site template ID/.

Particularly, when including components, "relative path to script" is the component inclusion path passed to the method CMain::IncludeFile as the first parameter.

Parameters

ParameterDescription
abs_path Absolute path to file for which the language message file is to be included.
lang The language ID.

Optional. By default, the current language is used (false).

See Also

Example



<?
// Include language file into the current component
// The language file is assumed to be stored in standard location
IncludeTemplateLangFile(__FILE__);
?>