Skip to content

Commit 6e3c4dd

Browse files
AzGasimgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 39a077c commit 6e3c4dd

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

packages/localization/src/Filament/Resources/LocalizationResource.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,33 +75,33 @@ public static function form(Schema $schema): Schema
7575
if ($state) {
7676
$language = StaticLanguage::find($state);
7777
if ($language) {
78-
$mainLocale = $language->alpha2 . '_' . strtoupper($language->alpha2);
78+
$mainLocale = $language->alpha2.'_'.strtoupper($language->alpha2);
7979
$set('locale_variant', $mainLocale);
8080
}
8181
}
8282
}),
8383
TextInput::make('title')
8484
->label(__('localization::fields.title'))
8585
->required()
86-
->afterStateUpdated(fn(Set $set, ?string $state) => $set('slug', Str::slug($state))),
86+
->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state))),
8787
TextInput::make('slug')
8888
->label(__('localization::fields.slug'))
8989
->required(),
9090
Select::make('locale_variant')
9191
->label('Locale Variant')
9292
->options(function ($get) {
9393
$languageId = $get('language_id');
94-
if (!$languageId) {
94+
if (! $languageId) {
9595
return [];
9696
}
9797

9898
$language = StaticLanguage::find($languageId);
99-
if (!$language) {
99+
if (! $language) {
100100
return [];
101101
}
102102

103103
$baseLanguage = $language->alpha2;
104-
$mainLocale = $baseLanguage . '_' . strtoupper($baseLanguage);
104+
$mainLocale = $baseLanguage.'_'.strtoupper($baseLanguage);
105105

106106
$locales = StaticLocale::where('language_id', $languageId)->with('country')->get();
107107

@@ -112,15 +112,15 @@ public static function form(Schema $schema): Schema
112112

113113
// Wenn es der Haupt-Locale ist (z.B. de_DE), zeige "Standard"
114114
if ($locale->locale === $mainLocale) {
115-
$options[$locale->locale] = $language->common_name . ' (Standard)';
115+
$options[$locale->locale] = $language->common_name.' (Standard)';
116116
} else {
117-
$options[$locale->locale] = $language->common_name . ' (' . $countryName . ')';
117+
$options[$locale->locale] = $language->common_name.' ('.$countryName.')';
118118
}
119119
}
120120

121121
// Falls kein Locale in der DB existiert, füge den Haupt-Locale hinzu
122122
if (empty($options)) {
123-
$options[$mainLocale] = $language->common_name . ' (Standard)';
123+
$options[$mainLocale] = $language->common_name.' (Standard)';
124124
}
125125

126126
return $options;
@@ -207,7 +207,7 @@ public static function table(Table $table): Table
207207
// Basic Info Group
208208
IconColumn::make('table_flag')
209209
->label('Flag')
210-
->icon(fn(string $state): string => $state),
210+
->icon(fn (string $state): string => $state),
211211
TextColumn::make('display_name')
212212
->label(__('localization::fields.language'))
213213
->searchable()
@@ -278,7 +278,7 @@ public static function table(Table $table): Table
278278
->groups([
279279
Group::make('language.common_name')
280280
->label(__('localization::fields.language'))
281-
->getTitleFromRecordUsing(fn(Localization $record): string => $record->language->common_name)
281+
->getTitleFromRecordUsing(fn (Localization $record): string => $record->language->common_name)
282282
->collapsible(),
283283
])
284284
->defaultGroup('language.common_name')

packages/localization/src/Models/Localization.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getLocaleAttribute(): string
7979
if (str_contains($locale, '_')) {
8080
$parts = explode('_', $locale, 2);
8181
if (count($parts) === 2) {
82-
$locale = $parts[0] . '_' . strtoupper($parts[1]);
82+
$locale = $parts[0].'_'.strtoupper($parts[1]);
8383
}
8484
}
8585

@@ -93,7 +93,7 @@ public function getLanguageSetting(string $key): bool
9393
{
9494
$settings = $this->language_settings ?? [];
9595

96-
if (!isset($settings[$key])) {
96+
if (! isset($settings[$key])) {
9797
return config("localization.language_selector.{$key}", true);
9898
}
9999

@@ -111,7 +111,7 @@ public function getDisplayNameAttribute(): string
111111

112112
$baseName = $useNativeNames ? $this->language->native_name : $this->language->common_name;
113113

114-
if (!$showRegionalVariants) {
114+
if (! $showRegionalVariants) {
115115
return $baseName;
116116
}
117117

@@ -121,8 +121,8 @@ public function getDisplayNameAttribute(): string
121121
$countryCode = strtolower($parts[1] ?? '');
122122

123123
$country = StaticCountry::where('alpha2', $countryCode)->first();
124-
if (!$country) {
125-
return $baseName . ' (' . strtoupper($countryCode) . ')';
124+
if (! $country) {
125+
return $baseName.' ('.strtoupper($countryCode).')';
126126
}
127127

128128
$countryName = $country->common_name; // Default fallback
@@ -134,7 +134,7 @@ public function getDisplayNameAttribute(): string
134134
}
135135
}
136136

137-
return $baseName . ' (' . $countryName . ')';
137+
return $baseName.' ('.$countryName.')';
138138
}
139139

140140
return $baseName;
@@ -147,7 +147,7 @@ public function getDisplayFlagAttribute(): string
147147
{
148148
$showRegionalVariants = $this->getLanguageSetting('show_regional_variants');
149149

150-
if (!$showRegionalVariants) {
150+
if (! $showRegionalVariants) {
151151
return $this->language->flag_icon;
152152
}
153153

@@ -157,7 +157,7 @@ public function getDisplayFlagAttribute(): string
157157
$countryCode = strtolower($parts[1] ?? '');
158158

159159
if ($countryCode && $this->flagExists($countryCode)) {
160-
return 'flag-' . $countryCode;
160+
return 'flag-'.$countryCode;
161161
}
162162
}
163163

@@ -175,7 +175,7 @@ public function getTableFlagAttribute(): string
175175
$countryCode = strtolower($parts[1] ?? '');
176176

177177
if ($countryCode && $this->flagExists($countryCode)) {
178-
return 'flag-' . $countryCode;
178+
return 'flag-'.$countryCode;
179179
}
180180
}
181181

@@ -187,12 +187,12 @@ public function getTableFlagAttribute(): string
187187
*/
188188
public function flagExists(string $flagCode): bool
189189
{
190-
$packagePath = base_path('packages/flag-icons-circle/resources/svg/' . $flagCode . '.svg');
190+
$packagePath = base_path('packages/flag-icons-circle/resources/svg/'.$flagCode.'.svg');
191191
if (file_exists($packagePath)) {
192192
return true;
193193
}
194194

195-
$publicPath = public_path('vendor/flag-icons-circle/' . $flagCode . '.svg');
195+
$publicPath = public_path('vendor/flag-icons-circle/'.$flagCode.'.svg');
196196

197197
return file_exists($publicPath);
198198
}
@@ -245,7 +245,7 @@ private function getCountryFlag(): string
245245
$countryCode = $languageToCountry[$this->language->alpha2] ?? $this->language->alpha2;
246246

247247
if ($this->flagExists($countryCode)) {
248-
return 'flag-' . $countryCode;
248+
return 'flag-'.$countryCode;
249249
}
250250

251251
return $this->language->flag_icon;

0 commit comments

Comments
 (0)