Skip to content

Commit

Permalink
fix: make entire attribution text translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
JaZo committed Nov 29, 2023
1 parent 8d4aaa3 commit f42caad
Showing 1 changed file with 64 additions and 32 deletions.
96 changes: 64 additions & 32 deletions src/ImageProviders/CuratedBySwis.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Swis\Filament\Backgrounds\ImageProviders;

use Illuminate\Support\Arr;
use Swis\Filament\Backgrounds\Contracts\ProvidesImages;
use Swis\Filament\Backgrounds\Image;

Expand All @@ -10,127 +11,158 @@ class CuratedBySwis implements ProvidesImages
protected const IMAGES = [
[
'url' => '01.jpg',
'author' => 'Sergey Zolkin on Unsplash',
'author' => 'Sergey Zolkin',
'service' => 'Unsplash',
],
[
'url' => '02.jpg',
'author' => 'Andrew Phillips on Unsplash',
'author' => 'Andrew Phillips',
'service' => 'Unsplash',
],
[
'url' => '03.jpg',
'author' => 'Ales Krivec on Unsplash',
'author' => 'Ales Krivec',
'service' => 'Unsplash',
],
[
'url' => '04.jpg',
'author' => 'Roger Burkhard on Unsplash',
'author' => 'Roger Burkhard',
'service' => 'Unsplash',
],
[
'url' => '05.jpg',
'author' => 'Colton Brown on Unsplash',
'author' => 'Colton Brown',
'service' => 'Unsplash',
],
[
'url' => '06.jpg',
'author' => 'Micah Hallahan on Unsplash',
'author' => 'Micah Hallahan',
'service' => 'Unsplash',
],
[
'url' => '07.jpg',
'author' => 'Michael Baird on Unsplash',
'author' => 'Michael Baird',
'service' => 'Unsplash',
],
[
'url' => '08.jpg',
'author' => 'Damir Kotoric on Unsplash',
'author' => 'Damir Kotoric',
'service' => 'Unsplash',
],
[
'url' => '09.jpg',
'author' => 'Alex Wigan on Unsplash',
'author' => 'Alex Wigan',
'service' => 'Unsplash',
],
[
'url' => '10.jpg',
'author' => 'Blake Verdoorn on Unsplash',
'author' => 'Blake Verdoorn',
'service' => 'Unsplash',
],
[
'url' => '11.jpg',
'author' => 'Sébastien Marchand on Unsplash',
'author' => 'Sébastien Marchand',
'service' => 'Unsplash',
],
[
'url' => '12.jpg',
'author' => 'unknown on Unsplash',
'author' => 'unknown',
'service' => 'Unsplash',
],
[
'url' => '13.jpg',
'author' => 'Ozark Drones on Unsplash',
'author' => 'Ozark Drones',
'service' => 'Unsplash',
],
[
'url' => '14.jpg',
'author' => 'Luís Perdigão on Unsplash',
'author' => 'Luís Perdigão',
'service' => 'Unsplash',
],
[
'url' => '15.jpg',
'author' => 'Martin Fisch on Flickr',
'author' => 'Martin Fisch',
'service' => 'Flickr',
],
[
'url' => '16.jpg',
'author' => 'Elizabeth Lies on Unsplash',
'author' => 'Elizabeth Lies',
'service' => 'Unsplash',
],
[
'url' => '17.jpg',
'author' => 'Daniela Cuevas on Unsplash',
'author' => 'Daniela Cuevas',
'service' => 'Unsplash',
],
[
'url' => '18.jpg',
'author' => 'Rebecca Johnston on Unsplash',
'author' => 'Rebecca Johnston',
'service' => 'Unsplash',
],
[
'url' => '19.jpg',
'author' => 'Demi DeHerrera on Unsplash',
'author' => 'Demi DeHerrera',
'service' => 'Unsplash',
],
[
'url' => '20.jpg',
'author' => 'Kellen Riggin on Unsplash',
'author' => 'Kellen Riggin',
'service' => 'Unsplash',
],
[
'url' => '21.jpg',
'author' => 'Sebastien Gabriel on Unsplash',
'author' => 'Sebastien Gabriel',
'service' => 'Unsplash',
],
[
'url' => '22.jpg',
'author' => 'Genta Mochizawa on Unsplash',
'author' => 'Genta Mochizawa',
'service' => 'Unsplash',
],
[
'url' => '23.jpg',
'author' => 'Modestas Urbonas on Unsplash',
'author' => 'Modestas Urbonas',
'service' => 'Unsplash',
],
[
'url' => '24.jpg',
'author' => 'Negative Space on Pexels',
'author' => 'Negative Space',
'service' => 'Pexels',
],
[
'url' => '25.jpg',
'author' => 'Joshua Earle on Unsplash',
'author' => 'Joshua Earle',
'service' => 'Unsplash',
],
[
'url' => '26.jpg',
'author' => 'Alex Padurariu on Unsplash',
'author' => 'Alex Padurariu',
'service' => 'Unsplash',
],
[
'url' => '27.jpg',
'author' => 'Skyler Smith on Unsplash',
'author' => 'Skyler Smith',
'service' => 'Unsplash',
],
[
'url' => '28.jpg',
'author' => 'unknown on Unsplash',
'author' => 'unknown',
'service' => 'Unsplash',
],
[
'url' => '29.jpg',
'author' => 'unknown on PxHere',
'author' => 'unknown',
'service' => 'PxHere',
],
[
'url' => '30.jpg',
'author' => 'Dominik Schröder on Unsplash',
'author' => 'Dominik Schröder',
'service' => 'Unsplash',
],
[
'url' => '31.jpg',
'author' => 'Robert Bye on Unsplash',
'author' => 'Robert Bye',
'service' => 'Unsplash',
],
];

Expand All @@ -145,7 +177,7 @@ public function getImage(): Image

return new Image(
'url("' . asset('images/swisnl/filament-backgrounds/curated-by-swis/' . $image['url']) . '")',
__('Photo by :author', ['author' => $image['author']])
__('Photo by :author on :service', Arr::only($image, ['author', 'service']))
);
}
}

0 comments on commit f42caad

Please sign in to comment.