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:
web-devinition.de 2025-11-12 21:35:02 +01:00 committed by GitHub
parent 5e3bd26e27
commit 54f318ecac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 1504 additions and 335 deletions

View file

@ -15,4 +15,4 @@
{% block new_title %}
{% trans %}attachment_type.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-tags fa-fw"></i> {% trans %}category.labelp{% endtrans %}
<i class="fas fa-tags fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block additional_pills %}
@ -61,4 +61,4 @@
</div>
{{ form_row(form.eda_info.kicad_symbol) }}
</div>
{% endblock %}
{% endblock %}

View file

@ -3,7 +3,7 @@
{% import "vars.macro.twig" as vars %}
{% block card_title %}
<i class="fa-solid fa-coins"></i> {% trans %}currency.caption{% endtrans %}
<i class="fa-solid fa-coins"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block additional_controls %}
@ -41,4 +41,4 @@
{% block new_title %}
{% trans %}currency.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-microchip fa-fw"></i> {% trans %}footprint.labelp{% endtrans %}
<i class="fas fa-microchip fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block master_picture_block %}
@ -34,4 +34,4 @@
</div>
{{ form_row(form.eda_info.kicad_footprint) }}
</div>
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-users fa-fw"></i> {% trans %}group.edit.caption{% endtrans %}
<i class="fas fa-users fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
@ -27,4 +27,4 @@
{% block new_title %}
{% trans %}group.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-qrcode fa-fw"></i> {% trans %}label_profile.caption{% endtrans %}
<i class="fas fa-qrcode fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block additional_pills %}
@ -58,4 +58,4 @@
{% block new_title %}
{% trans %}label_profile.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_company_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-industry fa-fw"></i> {% trans %}manufacturer.caption{% endtrans %}
<i class="fas fa-industry fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block edit_title %}
@ -10,4 +10,4 @@
{% block new_title %}
{% trans %}manufacturer.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-balance-scale fa-fw"></i> {% trans %}measurement_unit.caption{% endtrans %}
<i class="fas fa-balance-scale fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block edit_title %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-balance-scale fa-tools"></i> {% trans %}part_custom_state.caption{% endtrans %}
<i class="fas fa-balance-scale fa-tools"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block edit_title %}

View file

@ -3,7 +3,7 @@
{# @var entity App\Entity\ProjectSystem\Project #}
{% block card_title %}
<i class="fas fa-archive fa-fw"></i> {% trans %}project.caption{% endtrans %}
<i class="fas fa-archive fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block edit_title %}
@ -59,4 +59,4 @@
</a>
{% endif %}
</div>
{% endblock %}
{% endblock %}

View file

@ -2,7 +2,7 @@
{% import "label_system/dropdown_macro.html.twig" as dropdown %}
{% block card_title %}
<i class="fas fa-cube fa-fw"></i> {% trans %}storelocation.labelp{% endtrans %}
<i class="fas fa-cube fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block additional_controls %}
@ -38,4 +38,4 @@
{% block new_title %}
{% trans %}storelocation.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "admin/base_company_admin.html.twig" %}
{% block card_title %}
<i class="fas fa-truck fa-fw"></i> {% trans %}supplier.caption{% endtrans %}
<i class="fas fa-truck fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block additional_panes %}
@ -19,4 +19,4 @@
{% block new_title %}
{% trans %}supplier.new{% endtrans %}
{% endblock %}
{% endblock %}

View file

@ -5,7 +5,7 @@
{# @var entity \App\Entity\UserSystem\User #}
{% block card_title %}
<i class="fas fa-user fa-fw"></i> {% trans %}user.edit.caption{% endtrans %}
<i class="fas fa-user fa-fw"></i> {{ type_label_p(entity) }}
{% endblock %}
{% block comment %}{% endblock %}
@ -111,4 +111,4 @@
{% block preview_picture %}
<img src="{{ avatar_helper.avatarURL(entity) }}" style="height: 50px;">
{% endblock %}
{% endblock %}