mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed translation of stock change type in log table
This commit is contained in:
parent
b447a69dae
commit
9e69a09a19
2 changed files with 6 additions and 1 deletions
|
@ -139,7 +139,7 @@ class LogDataTable implements DataTableTypeInterface
|
|||
if ($context instanceof PartStockChangedLogEntry) {
|
||||
$text .= sprintf(
|
||||
' (<i>%s</i>)',
|
||||
$this->translator->trans('log.part_stock_changed.' . $context->getInstockChangeType()->toExtraShortType())
|
||||
$this->translator->trans($context->getInstockChangeType()->toTranslationKey())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,11 @@ enum PartStockChangeType: string
|
|||
};
|
||||
}
|
||||
|
||||
public function toTranslationKey(): string
|
||||
{
|
||||
return 'log.part_stock_changed.' . $this->value;
|
||||
}
|
||||
|
||||
public static function fromExtraShortType(string $value): self
|
||||
{
|
||||
return match ($value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue