mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +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) {
|
if ($context instanceof PartStockChangedLogEntry) {
|
||||||
$text .= sprintf(
|
$text .= sprintf(
|
||||||
' (<i>%s</i>)',
|
' (<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
|
public static function fromExtraShortType(string $value): self
|
||||||
{
|
{
|
||||||
return match ($value) {
|
return match ($value) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue