© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
Wannes

Translate Database Notifications?

Hi, is it possible to translate the database notifications? Especially if they are ran through a job.

For example the new Export Action, which does this:

public static function getCompletedNotificationBody(Export $export): string
    {
        $body = 'Uw contacten export is voltooid en ' . number_format($export->successful_rows) . ' ' . trans_choice('general.row', $export->successful_rows) . ' werden geëxporteerd.';

        if ($failedRowsCount = $export->getFailedRowsCount()) {
            $body .= ' ' . number_format($failedRowsCount) . ' ' . trans_choice('general.row', $failedRowsCount) . ' werden niet geëxporteerd.';
        }
    }
public static function getCompletedNotificationBody(Export $export): string
    {
        $body = 'Uw contacten export is voltooid en ' . number_format($export->successful_rows) . ' ' . trans_choice('general.row', $export->successful_rows) . ' werden geëxporteerd.';

        if ($failedRowsCount = $export->getFailedRowsCount()) {
            $body .= ' ' . number_format($failedRowsCount) . ' ' . trans_choice('general.row', $failedRowsCount) . ' werden niet geëxporteerd.';
        }
    }


That text needs to be translated in Dutch, French and English. However in the database notifications table, I don't see a way how to make it translatable.

Also in the redis itself I can't retrieve
app()->getLocale()
app()->getLocale()


because it always return the default locale. So I can't just handle it from there.

Since notifications are user based, I'm fine to just push the translatable strings to the database, but I can't seem to figure out how to access the user his locale in a Redis Job.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

translate notifications
FilamentFFilament / ❓┊help
2y ago
Database notifications
FilamentFFilament / ❓┊help
2y ago
Database notifications toast
FilamentFFilament / ❓┊help
3mo ago
Categorize database notifications
FilamentFFilament / ❓┊help
13mo ago