1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
localizablemessage.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Localization;
4
5
use Bitrix\Main\Diag;
6
use Bitrix\Main\IO\Path;
7
17
class
LocalizableMessage
implements
LocalizableMessageInterface
18
{
19
public
function
__construct(
20
protected
string
$code
,
21
protected
?
array
$replace =
null
,
22
protected
?
string
$language =
null
,
23
25
protected
?
string
$phraseSrcFile =
null
,
26
)
27
{
28
if
(!isset($this->phraseSrcFile))
29
{
30
// guess the file that owns the phrase
31
$trace =
Diag\Helper::getBackTrace
(1, DEBUG_BACKTRACE_IGNORE_ARGS);
32
$this->phraseSrcFile = Path::normalize($trace[0][
'file'
]);
33
}
34
}
35
36
public
function
localize
(
string
$language): ?string
37
{
38
$message
=
Loc::getMessage
($this->code, $this->replace, $language);
39
40
if
(!isset(
$message
))
41
{
42
Loc::loadLanguageFile
($this->phraseSrcFile, $language,
false
);
43
$message
=
Loc::getMessage
($this->code, $this->replace, $language);
44
}
45
46
return
$message
;
47
}
48
49
public
function
__toString
()
50
{
51
return
$this->
localize
($this->language ??
Loc::getCurrentLang
());
52
}
53
}
Bitrix\Main\Diag\Helper\getBackTrace
static getBackTrace($limit=0, $options=null, $skip=1)
Определения
helper.php:26
Bitrix\Main\Localization\Loc\loadLanguageFile
static loadLanguageFile($file, $language=null, $normalize=true)
Определения
loc.php:225
Bitrix\Main\Localization\Loc\getCurrentLang
static getCurrentLang()
Определения
loc.php:79
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Определения
loc.php:30
Bitrix\Main\Localization\LocalizableMessage
Определения
localizablemessage.php:18
Bitrix\Main\Localization\LocalizableMessage\__toString
__toString()
Определения
localizablemessage.php:49
Bitrix\Main\Localization\LocalizableMessage\localize
localize(string $language)
Определения
localizablemessage.php:36
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\Localization\LocalizableMessageInterface
Определения
localizablemessageinterface.php:6
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
$message
$message
Определения
payment.php:8
bitrix
modules
main
lib
localization
localizablemessage.php
Создано системой
1.14.0