mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-20 17:19:34 +00:00
Implemented the ability to set user-defined synonyms/labels for internal element types
* Implementiere bevorzugte Sprachauswahl und Datenquellen-Synonyme Die Spracheinstellungen/System-Settings wurden um die Möglichkeit ergänzt, bevorzugte Sprachen für die Dropdown-Menüs festzulegen. Zudem wurde ein Datenquellen-Synonymsystem implementiert, um benutzerfreundlichere Bezeichnungen anzuzeigen und zu personalisieren. * Anpassung aus Analyse * Entferne alten JSON-basierten Datenquellen-Synonym-Handler Die Verwaltung der Datenquellen-Synonyme wurde überarbeitet, um ein flexibleres und strukturiertes Konzept zu ermöglichen. Der bestehende JSON-basierte Ansatz wurde durch eine neue Service-basierte Architektur ersetzt, die eine bessere Handhabung und Erweiterbarkeit erlaubt. * Ermögliche Rückgabe aller möglichen Sprachoptionen in Verbindung mit den vom Nutzer freigeschalteten. * Removed unnecessary service definition The tag is applied via autoconfiguration * Use default translations for the NotBlank constraint * Started refactoring ElementTypeNameGenerator * Made ElementTypeNameGenerator class readonly * Modified form to work properly with new datastructure * Made the form more beautiful and space saving * Made synonym form even more space saving * Allow to define overrides for any element label there is * Use defined synonyms in ElementTypeNameGenerator * Use ElementTypeNameGenerator where possible * Register synonyms for element types as global translation parameters * Revert changes done to permission layout * Use new synonym system for admin page titles * Removed now unnecessary services * Reworked settings name and translation * Renamed all files to Synonyms * Removed unnecessary translations * Removed unnecessary translations * Fixed duplicate check * Renamed synoynms translations * Use our synonyms for permission translations * Fixed phpstan issue * Added tests --------- Co-authored-by: Marcel Diegelmann <marcel.diegelmann@gmail.com> Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
This commit is contained in:
parent
5e3bd26e27
commit
54f318ecac
43 changed files with 1504 additions and 335 deletions
|
|
@ -34,9 +34,9 @@ use App\Entity\ProjectSystem\Project;
|
|||
use App\Helpers\Trees\TreeViewNode;
|
||||
use App\Helpers\Trees\TreeViewNodeIterator;
|
||||
use App\Repository\NamedDBElementRepository;
|
||||
use App\Repository\StructuralDBElementRepository;
|
||||
use App\Services\Cache\ElementCacheTagGenerator;
|
||||
use App\Services\Cache\UserCacheKeyGenerator;
|
||||
use App\Services\ElementTypeNameGenerator;
|
||||
use App\Services\EntityURLGenerator;
|
||||
use App\Settings\BehaviorSettings\SidebarSettings;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
|
@ -67,6 +67,7 @@ class TreeViewGenerator
|
|||
protected TranslatorInterface $translator,
|
||||
private readonly UrlGeneratorInterface $router,
|
||||
private readonly SidebarSettings $sidebarSettings,
|
||||
private readonly ElementTypeNameGenerator $elementTypeNameGenerator
|
||||
) {
|
||||
$this->rootNodeEnabled = $this->sidebarSettings->rootNodeEnabled;
|
||||
$this->rootNodeExpandedByDefault = $this->sidebarSettings->rootNodeExpanded;
|
||||
|
|
@ -212,15 +213,7 @@ class TreeViewGenerator
|
|||
|
||||
protected function entityClassToRootNodeString(string $class): string
|
||||
{
|
||||
return match ($class) {
|
||||
Category::class => $this->translator->trans('category.labelp'),
|
||||
StorageLocation::class => $this->translator->trans('storelocation.labelp'),
|
||||
Footprint::class => $this->translator->trans('footprint.labelp'),
|
||||
Manufacturer::class => $this->translator->trans('manufacturer.labelp'),
|
||||
Supplier::class => $this->translator->trans('supplier.labelp'),
|
||||
Project::class => $this->translator->trans('project.labelp'),
|
||||
default => $this->translator->trans('tree.root_node.text'),
|
||||
};
|
||||
return $this->elementTypeNameGenerator->typeLabelPlural($class);
|
||||
}
|
||||
|
||||
protected function entityClassToRootNodeIcon(string $class): ?string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue