From c70f2522f51a1fc6ce221f786faad0f3d7d83058 Mon Sep 17 00:00:00 2001 From: ArrayIterator Date: Sun, 15 Oct 2023 16:54:02 +0700 Subject: [PATCH] add translation for name --- Benchmarks/CoreModuleAggregator.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Benchmarks/CoreModuleAggregator.php b/Benchmarks/CoreModuleAggregator.php index 54a08ef..a4489fb 100644 --- a/Benchmarks/CoreModuleAggregator.php +++ b/Benchmarks/CoreModuleAggregator.php @@ -29,6 +29,19 @@ public function getCore(): ?Core return $this->core; } + private bool $translated = false; + + public function getName(): string + { + if ($this->translated) { + return $this->name; + } + $this->translated = true; + return $this->name = $this + ->getCore() + ?->translate('Event', context: 'benchmark')??$this->name; + } + public function accepted(RecordInterface $record): bool { if ($record->getGroup()->getName() === $this->groupName) {