Skip to content

Commit

Permalink
[SonataExtraBundle] Add missing translation domain
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoiriert committed Dec 19, 2023
1 parent 6c4c7df commit a2e5760
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function __construct(
->scalarNode('controller_class')->defaultValue('sonata.admin.controller.crud')->end()
->scalarNode('icon')->defaultNull()->end()
->scalarNode('label')->defaultNull()->end()
->scalarNode('translation_domain')->defaultValue('SonataAdminBundle')->end()
->scalarNode('show_in_dashboard')->defaultTrue()->end()
->enumNode('pager_type')->values(['default', 'simple'])->defaultValue('default')->end()
->end();
Expand Down Expand Up @@ -64,7 +65,7 @@ public static function configureFromConfiguration(Definition $definition, array
array_filter(
array_intersect_key(
$config,
array_flip(['group', 'icon', 'label', 'pager_type', 'show_in_dashboard'])
array_flip(['group', 'icon', 'label', 'pager_type', 'show_in_dashboard', 'translation_domain'])
) + ['manager_type' => 'orm', 'model_class' => $config['entity_class'], 'controller' => $config['controller_class']],
fn ($value) => null !== $value
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
{% if link %}
<a href="{{ link }}" class="small-box-footer">
{{ link_label|trans({}, 'SonataAdminBundle') }} <i class="fas fa-arrow-circle-right" aria-hidden="true"></i>
{{ link_label|trans({}, translation_domain) }} <i class="fas fa-arrow-circle-right" aria-hidden="true"></i>
</a>
{% endif %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{% if filter_url %}
<a href="{{ filter_url }}" class="btn btn-sm btn-default">
<i class="fas fa-list" aria-hidden="true"></i>
List
{{ 'link_list'|trans({}, 'SonataAdminBundle') }}
</a>
{% endif %}
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function getDefaultConfiguration(): array
'label' => 'config',
'pager_type' => 'default',
'show_in_dashboard' => true,
'translation_domain' => 'SonataAdminBundle',
],
],
'console' => [
Expand All @@ -47,6 +48,7 @@ public function getDefaultConfiguration(): array
'label' => 'Execution',
'pager_type' => 'simple',
'show_in_dashboard' => true,
'translation_domain' => 'SonataAdminBundle',
],
'commands' => [],
],
Expand All @@ -60,6 +62,7 @@ public function getDefaultConfiguration(): array
'label' => 'Migration',
'pager_type' => 'default',
'show_in_dashboard' => true,
'translation_domain' => 'SonataAdminBundle',
],
],
'messenger' => [
Expand All @@ -76,6 +79,7 @@ public function getDefaultConfiguration(): array
'label' => 'Message',
'pager_type' => 'simple',
'show_in_dashboard' => true,
'translation_domain' => 'SonataAdminBundle',
'enabled' => true,
],
],
Expand Down Expand Up @@ -110,6 +114,7 @@ public function getDefaultConfiguration(): array
'label' => 'User lock',
'pager_type' => 'simple',
'show_in_dashboard' => true,
'translation_domain' => 'SonataAdminBundle',
],
],
],
Expand Down

0 comments on commit a2e5760

Please sign in to comment.