1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
localizablemessageplural.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Localization;
4
5use Bitrix\Main\Diag;
6use Bitrix\Main\IO\Path;
7
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}
static getBackTrace($limit=0, $options=null, $skip=1)
Определения helper.php:26
static loadLanguageFile($file, $language=null, $normalize=true)
Определения loc.php:225
static getCurrentLang()
Определения loc.php:79
static getMessagePlural(string $code, int $value, ?array $replace=null, ?string $language=null)
Определения loc.php:498
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$message
Определения payment.php:8