mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-11 04:39:33 +00:00
Korrekturen vornehmen
This commit is contained in:
parent
f7ec130010
commit
0814d1caf0
14 changed files with 14 additions and 139 deletions
|
|
@ -170,13 +170,6 @@ services:
|
|||
####################################################################################################################
|
||||
# Table settings
|
||||
####################################################################################################################
|
||||
App\DataTables\AssemblyDataTable:
|
||||
arguments:
|
||||
$visible_columns: '%partdb.table.assemblies.default_columns%'
|
||||
App\DataTables\AssemblyBomEntriesDataTable:
|
||||
arguments:
|
||||
$visible_columns: '%partdb.table.assemblies_bom.default_columns%'
|
||||
|
||||
App\DataTables\Helpers\ColumnSortHelper:
|
||||
shared: false # Service has a state so not share it between different tables
|
||||
|
||||
|
|
@ -197,25 +190,6 @@ services:
|
|||
$fontDirectory: '%kernel.project_dir%/var/dompdf/fonts/'
|
||||
$tmpDirectory: '%kernel.project_dir%/var/dompdf/tmp/'
|
||||
|
||||
####################################################################################################################
|
||||
# Trees
|
||||
####################################################################################################################
|
||||
App\Services\Trees\TreeViewGenerator:
|
||||
arguments:
|
||||
$dataSourceSynonyms: '%partdb.data_sources.synonyms%'
|
||||
App\Services\Trees\ToolsTreeBuilder:
|
||||
arguments:
|
||||
$dataSourceSynonyms: '%partdb.data_sources.synonyms%'
|
||||
|
||||
####################################################################################################################
|
||||
# Twig Extensions
|
||||
####################################################################################################################
|
||||
|
||||
App\Twig\DataSourceNameExtension:
|
||||
arguments:
|
||||
$dataSourceSynonyms: '%partdb.data_sources.synonyms%'
|
||||
tags: [ 'twig.extension' ]
|
||||
|
||||
####################################################################################################################
|
||||
# Part info provider system
|
||||
####################################################################################################################
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||
namespace App\Controller;
|
||||
|
||||
use App\DataTables\LogDataTable;
|
||||
use App\Entity\AssemblySystem\Assembly;
|
||||
use App\Entity\Attachments\AttachmentUpload;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ declare(strict_types=1);
|
|||
*/
|
||||
namespace App\Entity\LogSystem;
|
||||
|
||||
use App\Entity\AssemblySystem\Assembly;
|
||||
use App\Entity\AssemblySystem\AssemblyBOMEntry;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Entity\InfoProviderSystem\BulkInfoProviderImportJob;
|
||||
|
|
@ -80,9 +78,6 @@ enum LogTargetType: int
|
|||
case ASSEMBLY_BOM_ENTRY = 24;
|
||||
case PART_CUSTOM_STATE = 25;
|
||||
|
||||
case ASSEMBLY = 23;
|
||||
case ASSEMBLY_BOM_ENTRY = 24;
|
||||
|
||||
/**
|
||||
* Returns the class name of the target type or null if the target type is NONE.
|
||||
* @return string|null
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Entity\Parts;
|
||||
|
||||
use App\Entity\Parts\PartTraits\AssemblyTrait;
|
||||
use ApiPlatform\Doctrine\Common\Filter\DateFilterInterface;
|
||||
use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
|
||||
use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Entity\AssemblySystem\Assembly;
|
||||
use App\Entity\AssemblySystem\AssemblyBOMEntry;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\AttachmentContainingDBElement;
|
||||
use App\Entity\Attachments\AttachmentType;
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Twig;
|
||||
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class DataSourceNameExtension extends AbstractExtension
|
||||
{
|
||||
private TranslatorInterface $translator;
|
||||
private array $dataSourceSynonyms;
|
||||
|
||||
public function __construct(TranslatorInterface $translator, ?array $dataSourceSynonyms)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
$this->dataSourceSynonyms = $dataSourceSynonyms ?? [];
|
||||
}
|
||||
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
new TwigFunction('get_data_source_name', [$this, 'getDataSourceName']),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Based on the locale and data source names, gives the right synonym value back or the default translator value.
|
||||
*/
|
||||
public function getDataSourceName(string $dataSourceName, string $defaultKey): string
|
||||
{
|
||||
$locale = $this->translator->getLocale();
|
||||
|
||||
// Use alternative dataSource synonym (if available)
|
||||
if (isset($this->dataSourceSynonyms[$dataSourceName][$locale])) {
|
||||
return $this->dataSourceSynonyms[$dataSourceName][$locale];
|
||||
}
|
||||
|
||||
// Otherwise return the standard translation
|
||||
return $this->translator->trans($defaultKey);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
{% extends "admin/base_admin.html.twig" %}
|
||||
|
||||
{% block card_title %}
|
||||
{% set dataSourceName = get_data_source_name('category', 'category.labelp') %}
|
||||
{% set translatedSource = 'category.labelp'|trans %}
|
||||
<i class="fas fa-tags fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
<i class="fas fa-tags fa-fw"></i> {% trans %}category.labelp{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block additional_pills %}
|
||||
|
|
@ -63,4 +61,4 @@
|
|||
</div>
|
||||
{{ form_row(form.eda_info.kicad_symbol) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
{% extends "admin/base_admin.html.twig" %}
|
||||
|
||||
{% block card_title %}
|
||||
{% set dataSourceName = get_data_source_name('footprint', 'footprint.labelp') %}
|
||||
{% set translatedSource = 'footprint.labelp'|trans %}
|
||||
<i class="fas fa-microchip fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
<i class="fas fa-microchip fa-fw"></i> {% trans %}footprint.labelp{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block master_picture_block %}
|
||||
|
|
@ -36,4 +34,4 @@
|
|||
</div>
|
||||
{{ form_row(form.eda_info.kicad_footprint) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
{% extends "admin/base_company_admin.html.twig" %}
|
||||
|
||||
{% block card_title %}
|
||||
{% set dataSourceName = get_data_source_name('manufacturer', 'manufacturer.caption') %}
|
||||
{% set translatedSource = 'manufacturer.caption'|trans %}
|
||||
<i class="fas fa-industry fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
<i class="fas fa-industry fa-fw"></i> {% trans %}manufacturer.caption{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block edit_title %}
|
||||
|
|
@ -12,4 +10,4 @@
|
|||
|
||||
{% block new_title %}
|
||||
{% trans %}manufacturer.new{% endtrans %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
{# @var entity App\Entity\ProjectSystem\Project #}
|
||||
|
||||
{% block card_title %}
|
||||
{% set dataSourceName = get_data_source_name('project', 'project.caption') %}
|
||||
{% set translatedSource = 'project.caption'|trans %}
|
||||
<i class="fas fa-archive fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
<i class="fas fa-archive fa-fw"></i> {% trans %}project.caption{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block edit_title %}
|
||||
|
|
@ -61,4 +59,4 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
{% import "label_system/dropdown_macro.html.twig" as dropdown %}
|
||||
|
||||
{% block card_title %}
|
||||
{% set dataSourceName = get_data_source_name('storagelocation', 'storelocation.labelp') %}
|
||||
{% set translatedSource = 'storelocation.labelp'|trans %}
|
||||
<i class="fas fa-cube fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
<i class="fas fa-cube fa-fw"></i> {% trans %}storelocation.labelp{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block additional_controls %}
|
||||
|
|
@ -40,4 +38,4 @@
|
|||
|
||||
{% block new_title %}
|
||||
{% trans %}storelocation.new{% endtrans %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
{% extends "admin/base_company_admin.html.twig" %}
|
||||
|
||||
{% block card_title %}
|
||||
{% set dataSourceName = get_data_source_name('supplier', 'supplier.caption') %}
|
||||
{% set translatedSource = 'supplier.caption'|trans %}
|
||||
<i class="fas fa-truck fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
<i class="fas fa-truck fa-fw"></i> {% trans %}supplier.caption{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block additional_panes %}
|
||||
|
|
@ -21,4 +19,4 @@
|
|||
|
||||
{% block new_title %}
|
||||
{% trans %}supplier.new{% endtrans %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -6,36 +6,12 @@
|
|||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input tristate permission-checkbox permission_multicheckbox" id="mulit_check_{{ form.vars.label }}">
|
||||
<label class="form-check-label" for="mulit_check_{{ form.vars.label }}">
|
||||
{% set dataSource = '' %}
|
||||
{% if (form.vars.label == 'perm.part.categories') %}
|
||||
{% set dataSource = 'category' %}
|
||||
{% elseif (form.vars.label == 'perm.storelocations') %}
|
||||
{% set dataSource = 'storagelocation' %}
|
||||
{% elseif (form.vars.label == 'perm.part.footprints') %}
|
||||
{% set dataSource = 'footprint' %}
|
||||
{% elseif (form.vars.label == 'perm.part.manufacturers') %}
|
||||
{% set dataSource = 'manufacturer' %}
|
||||
{% elseif (form.vars.label == 'perm.part.supplier') %}
|
||||
{% set dataSource = 'supplier' %}
|
||||
{% elseif (form.vars.label == 'perm.projects') %}
|
||||
{% set dataSource = 'project' %}
|
||||
{% elseif (form.vars.label == 'perm.assemblies') %}
|
||||
{% set dataSource = 'assembly' %}
|
||||
{% endif %}
|
||||
|
||||
{% set dataSourceName = get_data_source_name(dataSource, form.vars.label) %}
|
||||
{% set translatedSource = form.vars.label|trans %}
|
||||
{% if dataSourceName != translatedSource %}
|
||||
{{ translatedSource }}
|
||||
<i class="fas fa-fw fa-info" title="{{ 'datasource.synonym'|trans({'%name%': '', '%synonym%': dataSourceName })|raw }}"></i>
|
||||
{% else %}
|
||||
{{ translatedSource }}
|
||||
{% endif %}
|
||||
<b>{{ form.vars.label | trans }}</b>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<b>def{{ form.vars.label | trans }}</b>
|
||||
<b>{{ form.vars.label | trans }}</b>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2542,12 +2542,6 @@
|
|||
<target>Μη έγκυρη κανονική έκφραση (regex)</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="a7uOieC" name="datasource.synonym">
|
||||
<segment state="translated">
|
||||
<source>datasource.synonym</source>
|
||||
<target>%name% (Το συνώνυμό σας: %synonym%)</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="dsG4xTQ" name="category.edit.part_ipn_prefix">
|
||||
<segment state="translated">
|
||||
<source>category.edit.part_ipn_prefix</source>
|
||||
|
|
@ -3657,11 +3651,5 @@
|
|||
<target>Επεξεργασία</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="a7uOieC" name="datasource.synonym">
|
||||
<segment state="translated">
|
||||
<source>datasource.synonym</source>
|
||||
<target>%name% (Το συνώνυμό σας: %synonym%)</target>
|
||||
</segment>
|
||||
</unit>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue