Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Translate #27

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/Filament/Resources/EmailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use RickDBCN\FilamentEmail\Filament\Resources\EmailResource\Pages\ViewEmail;
use RickDBCN\FilamentEmail\Mail\ResendMail;
use RickDBCN\FilamentEmail\Models\Email;
use Exception;


class EmailResource extends Resource
{
Expand All @@ -28,15 +30,33 @@ class EmailResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-envelope';

protected static ?string $slug = 'emails';

public static function getNavigationLabel(): string
{
return Config::get('filament-email.label') ?? __('Email log');
try{
$str =Config::get('filament-email.label');
if($str == null){
return __('Email log');
}else{
return __($str);
}
}catch(Exception $ex){
return __('Email log');
}
}

public static function getNavigationGroup(): ?string
{
return Config::get('filament-email.resource.group' ?? parent::getNavigationGroup());
try{
$str =Config::get('filament-email.resource.group');
if($str == null){
return parent::getNavigationGroup();
}else{
return __($str);
}
}catch(Exception $ex){
return parent::getNavigationGroup();
}
}

public static function getNavigationSort(): ?int
Expand Down