Comments (5)
Actions generate their labels from the name of the action. For actions like CreateAction, we define a label in setUp()
that is localised for convenience. By setting that to null, you are removing it.
Changing it would be a breaking change for people who want to remove the localised label. And also, in my opinion the current behaviour is expected and I would not change it even in a major version.
from filament.
@danharrin - Understood. Thank you for the explanation. That was helpful and clarified things for me. Is there a way to localize an action button without a model label so that instead of "Create book" (English) or "Crear book" (Spanish), I get "Create" and "Crear" without having to use a custom label()
and lean on the existing Filament language files?
from filament.
Have a look at the existing translation string we use, and pass an empty string as the model label?
from filament.
@danharrin - This is the solution that I have used:
CreateAction::make()
->label(fn (): string => __('filament-actions::create.single.label', ['label' => null]));
This results in "New" in English and "Crear" in Spanish.
I yanked that from here. I was worried that was a bad practice which is why I was looking for an alternative.
Thank you again for all your hard work. You've made my team's job easier.
from filament.
Yeah that looks good to me
from filament.
Related Issues (20)
- Internal data leaking to the client browser using the Edit form HOT 4
- Laravel Spark Multi-Tenancy Redirect Billing not Found HOT 1
- 422 (Unprocessable Content) Bug when uploading more then 2mb files in production (live server) HOT 1
- sortable() stops working on columns placed inside a Filament\Tables\Columns\ColumnGroup HOT 1
- Custom Infolist Repeatable Entry form field is getting hidden HOT 3
- Side menu collapsing issue HOT 1
- Column Tooltip will not correctly disappear if content is evaluated by Closure
- Cursor pagination doesn't work HOT 1
- `make:filament-resource` fails when using the `--generate` option HOT 2
- Cannot login - XSRF issue? HOT 1
- The requiredWithoutAll validation method on the FileUpload component is invalid. HOT 3
- Add X Icon to delete file event URL is broken HOT 1
- Got Call to a member function auth() on null error on filament testing HOT 8
- Login doesn't work. HOT 1
- Checkbox Column target wrong row when using multiple orWhere clauses. HOT 1
- I have to click 2× to open the model HOT 1
- BelongsToModel->saveRelationships can bypass recommended authorization HOT 1
- ERROR in an optional parameter of a route when update Filament from 3.0.92 to 3.2.4 HOT 1
- Action Modal Would not open HOT 5
- The rich editor's toolbar is unusable with very large contents HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament.