question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<Resource options={{ label: 'resource.myResource.myKey' }} /> does not get translated

See original GitHub issue

I have tried the following:

<Resource
    options={{ label: 'resource.myResource.myKey' }}
/>

According to documentation: https://marmelab.com/react-admin/Resource.html

options.label allows to customize the display name of a given resource in the menu.

and https://marmelab.com/react-admin/Translation.html

// don't do this
<TextField source="first_name" label={translate('myroot.first_name')} />

// do this instead
<TextField source="first_name" label="myroot.first_name" />

I don’t know if it’s a bug but it looks like it.

React-admin 3.3.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fzaninottocommented, Mar 19, 2020

That’s right, there are 2 options to customize the label. If you use both, one will be ignored. We should probably throw an exception in that case so that the problem isn’t considered as a bug.

1reaction
JulienMattiussicommented, Mar 19, 2020

I found someting. If your language file contains a resources.myResource.name entry, then this is always used and your options={{ label: 'something' }} isn’t used But when you remove resources.myResource.name from your language file, then the open.label you setted is used and correctly translated.

Does it fit with your case @kopax ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with asp.net expression builder - Stack Overflow
I made a dummy skeleton project too with only a few lines of code, there I have 2 resource files in the App_GlobalResources...
Read more >
Translating by way of english text but not resource key's?
Hi, I write everything that needs to be translated in english ( static text, text on labels and buttons and data coming up...
Read more >
Script Language: Function Reference - Appway Community
Returns an indexed collection of all object names in the application cache. This function does not check if the cache entries have expired....
Read more >
Developing Oracle JET Apps Using MVVM Architecture
Lazy loading of localized resource strings at run time ... To begin using Oracle JET, you do not need to understand more than...
Read more >
Custom pluggable types for ... - The Checker Framework Manual
jar files can be used for pluggable type-checking of client code. If you compile code without the -processor command-line option, no checking of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found