R
Refine

ask-any-question

How to customize/localize a resource's name?

Yyelping-magenta1/22/2024
Hi, is there any place where we can set a name of a resource, better with multiple language versions, in order to display the name when a resource is saved or deleted? In the image below I can't find where I can change the name of the resource in the message
No description
Kkapa.ai1/22/2024
Hi @Eric Hu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you can customize the name of a resource using the meta property in the <Refine> component. The label property inside meta is used to set the name to show in the menu. By default, the plural form of the resource name is shown. Here is an example:
<Refine
resources={[
{
/* ... */
meta: { label: "custom" },
},
]}
/>
<Refine
resources={[
{
/* ... */
meta: { label: "custom" },
},
]}
/>
(Source: Refine Documentation (https://refine.dev/docs/core/refine-component#meta)) For localization or supporting multiple languages, Refine supports i18n. You can create your own translation files to override Refine's default texts. The translation keys that you can override are listed in the documentation. (Source: Refine Documentation (https://refine.dev/docs/guides-concepts/i18n#translation-file)) However, based on the provided extracts, there is no specific information on how to localize the resource name in the save or delete message. You may need to refer to the full documentation or the community for more specific guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai1/22/2024
<@454649036289343500> kapa.ai is still learning and improving, please let us know how it did by reacting below
Yyelping-magenta1/22/2024
@kapa.ai So it's meta: {label: "custom"} instead of options: { label: "custom" } right?
Kkapa.ai1/22/2024
Let me check the knowledge base for you. One moment! :books: ---------------------- Yes, that's correct. In the migration from version 3.x.x to 4.x.x of Refine, the options prop of a resource was deprecated and replaced with the meta prop. So you should use meta: { label: "custom" } to set a custom name for your resource. Here's how you can do it:
<Refine
resources={[
{
name: "posts",
meta: { label: "custom" },
},
]}
/>
<Refine
resources={[
{
name: "posts",
meta: { label: "custom" },
},
]}
/>
(Source: Refine Documentation (https://refine.dev/docs/migration-guide/3x-to-4x#resource-optionss-to-meta)) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai1/22/2024
<@454649036289343500> kapa.ai is still learning and improving, please let us know how it did by reacting below

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
savewhen create a new item or product and clicking a save i want to pass props that are outside of formHow to disable the submit button after clicking it, and restore it when submits fails?Hi, I'm using Ant Design to build a very complicated form. However when I click the submit button (bHow to return a specific error message from the backend server for the resource update / create?Hi, I'm using `@nestjsx/crud` adapter with Refine. What I want to do is that I want to rewrite some How to hide resource from sidebarHow can I hide a menu item from sidebar resource? I want to hide some particular menu links from myAdd a a POST api call on an a page when editThanks for an awsome framework. I have a page where i do some edits on some fields. Now I also need Crud api headerHow can i add a auth token to the header that i call if i use infencerSupabase and RBACHow to implement supabase and RBAC in refine?Group Nav buttons in a bulk buttonHi in the CRUD App is there a way to Group Nav buttons in a bulk button that hide and reveal subbuttSupabase- Ability for admin user to add usersHi everyone, I have a client who's plan for a crud app is to disable user signup as it'll be an inteHow to load a component both in Authenticated and Unauthenticated state?How can I arrange my routes to load a component page both in authenticated and unathenticated state?crud operator for text[]Hi guys, I can't filter my field I have a field name superfood which is a text array in supabase db Nextjs app routerHow setup refine using the latest nextjs app router and shadcn uiWhen sidebar is collapsed, changing page on paginated list open sidebar menu itemWhen changing the page, the page and offset query parameter of path is modified and is detected as aUseMany missing in some generated pages by the MUIinferencerWhats the reason why some List pages are generated by the MUIinferencer with the UseMany methods andgraphql mutationi am using graphql for and i want to pass different meta fields for getOne and update using useForm Filter a table field with outside component and stateHi guys, I'm using useTable to get data from database, here is my useTable code ```const filter = su