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
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1244931219548803072/Screenshot_from_2024-05-28_15-23-28.png)
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1244931219888537630/Screenshot_from_2024-05-28_15-25-22.png)
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 description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1244944092492992653/Screenshot_2024-05-28_at_12.21.28_PM.png)
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
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250042165703217193/image.png)
I do publish the translation
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250042320720760964/image.png)
even if you have published languages it doesn't mean all values are translated
all values are translated
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250048571626098698/image.png)
The db notification does not get translated according to the app locale. simple notification work fine
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250049171184943114/image.png)
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
notification![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250052126642667612/image.png)
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250052126944792618/image.png)
maybe 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