F
Filament2mo ago
Vp

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
No description
Solution:
Yes, sync is working, database always showing 'English'
Jump to solution
29 Replies
Vp
Vp2mo ago
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 found
Lara Zeus
Lara Zeus2mo ago
check the class ExportCompletion they are translated ->title(__('filament-actions::export.notifications.completed.title')) but it always store the current active locale
Vp
Vp2mo ago
For me always store "English" only, yeah title body download action were translated (based on code), but I got only English in DB
Lara Zeus
Lara Zeus2mo ago
did you published the lang files? maybe they not updated?
No description
Vp
Vp2mo ago
No, not published.. and I don't have any missing translation for export for km
Lara Zeus
Lara Zeus2mo ago
one thing that my QUEUE_CONNECTION is sync not sure if affect this, since in queue the default is en I think!
Solution
Vp
Vp2mo ago
Yes, sync is working, database always showing 'English'
Lara Zeus
Lara Zeus2mo ago
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()
Vp
Vp2mo ago
I don't have any idea where to start for this new feature 🤣
Lara Zeus
Lara Zeus2mo ago
then I suggest report it as a bug, maybe the team will do better than us 😅
Vp
Vp2mo ago
sure
Umar Farooq
Umar Farooq4w ago
I'm facing same issue
No description
Umar Farooq
Umar Farooq4w ago
I do publish the translation
No description
krekas
krekas4w ago
even if you have published languages it doesn't mean all values are translated
Umar Farooq
Umar Farooq4w ago
all values are translated
No description
Umar Farooq
Umar Farooq4w ago
The db notification does not get translated according to the app locale. simple notification work fine
No description
krekas
krekas4w ago
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
Umar Farooq
Umar Farooq4w ago
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
krekas
krekas4w ago
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
Umar Farooq
Umar Farooq4w ago
no, I double check the __('filament-actions::export.notifications.completed.title') working fine expect inside the db notification
Umar Farooq
Umar Farooq4w ago
No description
No description
krekas
krekas4w ago
maybe some cache issue then?
Umar Farooq
Umar Farooq4w ago
I try to flush all the redis cache
Vp
Vp4w ago
This is the solution ATM @Umar Farooq You can read another solution here https://github.com/filamentphp/filament/issues/12974
Umar Farooq
Umar Farooq4w ago
HasLocalPreference is not working
/**
* @return string|null
*/
public function preferredLocale(): ?string
{
return \App::getLocale();
}
/**
* @return string|null
*/
public function preferredLocale(): ?string
{
return \App::getLocale();
}
Vp
Vp4w ago
Yeah I also have the same problem..
Umar Farooq
Umar Farooq4w ago
no solution? 🥲
Vp
Vp4w ago
Just use QUEUE_CONNECTION=sync 🤣 no solution atm
Umar Farooq
Umar Farooq4w ago
Want results from more Discord servers?
Add your server
More Posts
Multiple Modal IssueI stumbled upon an issue where I have multiple actions(opening modals). Whenever I open a modal, cloSQLSTATE[IMSSP]: Field 34 returned no data.Currently, I am facing an issue in displaying data from SQL Server. Why am I encountering an error lQuickly switching routes from panel nav, cause blank page or freezeswitching routes several times and quickly cause: in firefox: - blank page and this console error: "I have the navbar overlapping issue inside a resource with inbuilt database notification openmodalI have the navbar overlapping issue inside a resource with inbuilt database notification openmodalwhen using TrashedFilter Bulk actions disappearWhen using TrashedFilter, Bulk actions disappear, They show up again if TrashedFilter:make('another-HasManyThrough repeater relationI am having the following problem where I want to show results in a repeater from a hasManyThroug rehow to pass a variable to importer and use it inside getColumnsHi, I would like to pass a variable to an importer and use it inside the importer's getColumns functDisplaying data without an ID or primary keyI want to display data from a table, but if I use Filemant, how can I do it? I don't have an ID coluHasOne relationship not updating foreignKey in parent modelHi there, I have two models, `Project` & `ProjectAttachment`. The relation in `Project` model is: ``Is there a way to do a combo box form input for creating/editing?I'd like to give people the ability to type in a text input field, and have it search for any curren