Skip to content

Commit 0219b97

Browse files
committed
default collection translation
1 parent 3c6d1e1 commit 0219b97

File tree

4 files changed

+104
-2
lines changed

4 files changed

+104
-2
lines changed

config/media

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Moox Configuration
6+
|--------------------------------------------------------------------------
7+
|
8+
| This configuration file uses translatable strings. If you want to
9+
| translate the strings, you can do so in the language files
10+
| published from moox_core. Example:
11+
|
12+
| 'trans//core::core.all',
13+
| loads from common.php
14+
| outputs 'All'
15+
|
16+
*/
17+
18+
return [
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Title
23+
|--------------------------------------------------------------------------
24+
|
25+
| The translatable title of the Resource in singular and plural.
26+
|
27+
*/
28+
29+
'model_label' => 'trans//media::media.media',
30+
'plural_model_label' => 'trans//media::media.medias',
31+
32+
/*
33+
|--------------------------------------------------------------------------
34+
| Navigation Group
35+
|--------------------------------------------------------------------------
36+
|
37+
| The translatable title of the navigation group in the
38+
| Filament Admin Panel. Instead of a translatable
39+
| string, you may also use a simple string.
40+
|
41+
*/
42+
43+
'navigation_group' => 'trans//core::core.cms',
44+
45+
/*
46+
|--------------------------------------------------------------------------
47+
| Upload
48+
|--------------------------------------------------------------------------
49+
|
50+
| The configuration for the upload feature.
51+
|
52+
*/
53+
54+
'upload' => [
55+
'resource' => [
56+
'icon' => 'heroicon-m-arrow-up-tray',
57+
'disk' => config('filament.default_filesystem_disk', 'public'),
58+
'directory' => 'media',
59+
'visibility' => 'public',
60+
'multiple' => true,
61+
'max_file_size' => 10240,
62+
'min_file_size' => null,
63+
'max_files' => null,
64+
'min_files' => null,
65+
'accepted_file_types' => ['image/*', 'video/*', 'application/pdf', 'audio/*', 'text/*', 'application/*'],
66+
'image_resize_mode' => 'cover',
67+
'image_crop_aspect_ratio' => null,
68+
'image_resize_target_width' => null,
69+
'image_resize_target_height' => null,
70+
'image_editor' => [
71+
'enabled' => true,
72+
'aspect_ratios' => [
73+
null,
74+
'16:9',
75+
'4:3',
76+
'1:1',
77+
],
78+
'viewport_width' => '1920',
79+
'viewport_height' => '1080',
80+
'mode' => 1,
81+
'empty_fill_color' => 'transparent',
82+
],
83+
'panel_layout' => 'grid',
84+
'orientation_from_exif' => true,
85+
'show_download_button' => true,
86+
'show_open_button' => true,
87+
'show_preview' => true,
88+
'reorderable' => true,
89+
'append_files' => true,
90+
],
91+
],
92+
93+
'modal' => [
94+
'resource' => [
95+
'show_download_button' => false,
96+
],
97+
],
98+
99+
100+
];

packages/media/resources/lang/de/fields.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'not_used' => 'Nicht verwendet',
2121
'uploaded_at' => 'Hochgeladen am',
2222
'collection' => 'Sammlung',
23+
'default_collection' => 'Allgemein',
2324

2425
// Actions
2526
'select_multiple' => 'Mehrere auswählen',

packages/media/resources/lang/en/fields.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'not_used' => 'Not Used',
2121
'uploaded_at' => 'Uploaded At',
2222
'collection' => 'Collection',
23+
'default_collection' => 'Default',
2324

2425
// Actions
2526
'select_multiple' => 'Select Multiple',

packages/media/src/Resources/MediaResource/Pages/ListMedia.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getHeaderActions(): array
3636
->toArray();
3737
})
3838
->searchable()
39-
->default('default')
39+
->default(__('media::fields.default_collection'))
4040
->required()
4141
->live(),
4242
FileUpload::make('file')
@@ -72,7 +72,7 @@ public function getHeaderActions(): array
7272
}
7373

7474
$processedFiles = session('processed_files', []);
75-
$collection = $get('collection_name') ?? 'default';
75+
$collection = $get('collection_name') ?? __('media::fields.default_collection');
7676

7777
foreach ($state as $key => $tempFile) {
7878
if (in_array($key, $processedFiles)) {

0 commit comments

Comments
 (0)