use Bitrix\Main\Localization\Loc; $name = "John"; $message = Loc::getMessage("MY_APP_HELLO_MESSAGE", array("#NAME#" => $name)); echo $message;In this example, the message code "MY_APP_HELLO_MESSAGE" is used to retrieve the localized message from the language file, and the placeholder "#NAME#" is replaced with the value of the $name variable. The package library for this code example is "Bitrix".