Skip to content

Commit 2b069f7

Browse files
authored
feat: translate plurals independently (#115)
1 parent 197185d commit 2b069f7

File tree

7 files changed

+40
-0
lines changed

7 files changed

+40
-0
lines changed

src/Filament/Resources/ComponentGroupResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,9 @@ public static function getLabel(): ?string
9797
{
9898
return __('Component Group');
9999
}
100+
101+
public static function getPluralLabel(): ?string
102+
{
103+
return __('Component Groups');
104+
}
100105
}

src/Filament/Resources/ComponentResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ public static function getLabel(): ?string
118118
return __('Component');
119119
}
120120

121+
public static function getPluralLabel(): ?string
122+
{
123+
return __('Components');
124+
}
125+
121126
public static function getNavigationBadge(): ?string
122127
{
123128
return static::getModel()::outage()->count();

src/Filament/Resources/IncidentResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ public static function getLabel(): ?string
177177
return __('Incident');
178178
}
179179

180+
public static function getPluralLabel(): ?string
181+
{
182+
return __('Incidents');
183+
}
184+
180185
public static function getNavigationBadge(): ?string
181186
{
182187
return static::getModel()::unresolved()->count();

src/Filament/Resources/IncidentTemplateResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,9 @@ public static function getLabel(): ?string
109109
{
110110
return __('Incident Template');
111111
}
112+
113+
public static function getPluralLabel(): ?string
114+
{
115+
return __('Incident Templates');
116+
}
112117
}

src/Filament/Resources/MetricResource.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ public static function table(Table $table): Table
136136
->defaultSort('order');
137137
}
138138

139+
public static function getLabel(): ?string
140+
{
141+
return __('Metric');
142+
}
143+
144+
public static function getPluralLabel(): ?string
145+
{
146+
return __('Metrics');
147+
}
148+
139149
public static function getRelations(): array
140150
{
141151
return [

src/Filament/Resources/ScheduleResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ public static function getLabel(): ?string
111111
return __('Schedule');
112112
}
113113

114+
public static function getPluralLabel(): ?string
115+
{
116+
return __('Schedules');
117+
}
118+
114119
public static function getNavigationBadge(): ?string
115120
{
116121
return static::getModel()::incomplete()->count();

src/Filament/Resources/SubscriberResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public static function getPages(): array
105105
}
106106

107107
public static function getLabel(): ?string
108+
{
109+
return __('Subscriber');
110+
}
111+
112+
public static function getPluralLabel(): ?string
108113
{
109114
return __('Subscribers');
110115
}

0 commit comments

Comments
 (0)