export notification message doesn't change base on locale
As we can see from image, I have translation file in
action/km/export
but on the notification list, only english is displayed.
This line "Your league export..."
is exceptional cause I didn't create a translation text, but both "Export Completed & Download.xls" should translate..
I use km
and zh_CN
locale, in both locale this "Export Completed" and "Download" is not translated
How to resolve this?
version: v3.2.83
29 Replies
Checking this more and more:
1. Notification list is displayed from database
notifications
table
2. While exporting, it doesn't check translation files and store english word only (Export completed, Download.**)
3. The body text (Your league ...) also not checking translation, it just store default english only..
I may be wrong also, but these are what I foundcheck the class
ExportCompletion
they are translated
->title(__('filament-actions::export.notifications.completed.title'))
but it always store the current active localeFor me always store "English" only, yeah
title
body
download action
were translated (based on code), but I got only English in DBdid you published the lang files? maybe they not updated?
No, not published.. and I don't have any missing translation for export for
km
one thing that my QUEUE_CONNECTION is sync not sure if affect this, since in queue the default is en I think!
Solution
Yes,
sync
is working, database
always showing 'English'ya thought so
https://laravel.com/docs/11.x/notifications#localizing-notifications
there is a chance to send PR new feature for filament to support something like:
Notification::make()->locale('es')->send()
I don't have any idea where to start for this new feature 🤣
then I suggest report it as a bug, maybe the team will do better than us 😅
sure
I'm facing same issue
I do publish the translation
even if you have published languages it doesn't mean all values are translated
all values are translated
The db notification does not get translated according to the app locale. simple notification work fine
there's no such language zh
https://github.com/filamentphp/filament/tree/3.x/packages/actions/resources/lang
it's either
zh_CN
or zh_TW
Yes, I just need "zh", not "zh_CN" for China, "zh_TW" for Taiwan, or "zh_SG" for Singapore.
other translations are working fine according to zh
by default laravel fallbacks locale to english
https://github.com/laravel/laravel/blob/11.x/config/app.php#L83
so it should be some translations missing
or maybe the locale is set wrong
no, I double check the
__('filament-actions::export.notifications.completed.title')
working fine expect inside the db
notificationmaybe some cache issue then?
I try to flush all the redis cache
This is the solution ATM @Umar Farooq You can read another solution here https://github.com/filamentphp/filament/issues/12974
HasLocalPreference
is not working
Yeah I also have the same problem..
no solution? 🥲
Just use
QUEUE_CONNECTION=sync
🤣 no solution atm