1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
localizablemessageplural.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Localization;
4
5
use Bitrix\Main\Diag;
6
use Bitrix\Main\IO\Path;
7
17
class
LocalizableMessagePlural
implements
LocalizableMessageInterface
18
{
19
public
function
__construct(
20
protected
string
$code
,
21
protected
int
$value,
22
protected
?
array
$replace =
null
,
23
protected
?
string
$language =
null
,
24
26
protected
?
string
$phraseSrcFile =
null
,
27
)
28
{
29
if
(!isset($this->phraseSrcFile))
30
{
31
// guess the file that owns the phrase
32
$trace =
Diag\Helper::getBackTrace
(1, DEBUG_BACKTRACE_IGNORE_ARGS);
33
$this->phraseSrcFile = Path::normalize($trace[0][
'file'
]);
34
}
35
}
36
37
public
function
localize
(
string
$language): ?string
38
{
39
$message
=
Loc::getMessagePlural
($this->code, $this->value, $this->replace, $language);
40
41
if
(!isset(
$message
))
42
{
43
Loc::loadLanguageFile
($this->phraseSrcFile, $language,
false
);
44
$message
=
Loc::getMessagePlural
($this->code, $this->value, $this->replace, $language);
45
}
46
47
return
$message
;
48
}
49
50
public
function
__toString
()
51
{
52
return
$this->
localize
($this->language ??
Loc::getCurrentLang
());
53
}
54
}
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\getMessagePlural
static getMessagePlural(string $code, int $value, ?array $replace=null, ?string $language=null)
Определения
loc.php:498
Bitrix\Main\Localization\LocalizableMessagePlural
Определения
localizablemessageplural.php:18
Bitrix\Main\Localization\LocalizableMessagePlural\__toString
__toString()
Определения
localizablemessageplural.php:50
Bitrix\Main\Localization\LocalizableMessagePlural\localize
localize(string $language)
Определения
localizablemessageplural.php:37
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
localizablemessageplural.php
Создано системой
1.14.0