How to customize/localize a resource's name?
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](https://cdn.answeroverflow.com/1198938069718552626/image.png)
5 Replies
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:
(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:
----------------------<@454649036289343500> kapa.ai is still learning and improving, please let us know how it did by reacting below
useful-bronze•8mo ago
@kapa.ai So it's meta: {label: "custom"} instead of options: { label: "custom" } right?
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:
(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:
----------------------<@454649036289343500> kapa.ai is still learning and improving, please let us know how it did by reacting below