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.

v4: custom <Admin /> removes all labels (i18n?)

See original GitHub issue

When using the AdminContext instead of <Admin /> all labels change into what I assume are keys.

Upon checking the code I think this is the issue:

Admin.defaultProps = {
    i18nProvider: defaultI18nProvider,
    store: localStorageStore(),
};

These aren’t mentioned in the docs. I think this should be added to the docs, or should be moved into <AdminContext />.

What you were expecting:

I was expecting nothing to change and everything to look the same.

What happened instead:

After following this guide: https://marmelab.com/react-admin/doc/4.0/Admin.html#unplugging-the-admin-using-admincontext-and-adminui

I got the following result:

image

Related code:

My <App /> looks like this now (removed most resources and the irrelevant bits for brevity):

function App() {
  return (
    <AdminContext authProvider={authProvider} dataProvider={withUpload}>
      <AsyncResources />
    </AdminContext>
  );
}

function AsyncResources() {
  return (
    <AdminUI layout={MyLayout} loginPage={SignIn} disableTelemetry={true}>
      <Resource name="profiles" list={ProfileList} show={ProfileShow} edit={ProfileEdit} create={ProfileCreate} />
      <Resource name="users" list={UserList} show={UserShow} edit={UserEdit} create={UserCreate} />
    </AdminUI>
  );
}

Environment

  • React-admin version: 4.0.0-rc.1
  • React version: 17.0.2
  • Browser: Chrome
  • Stack trace (in case of a JS error): N/A

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RWOverdijkcommented, Apr 12, 2022

@fzaninotto https://github.com/marmelab/react-admin/pull/7524

You know I’ve been around for a while because of the fork name lol

0reactions
fzaninottocommented, Apr 12, 2022

Fixed by #7524

Read more comments on GitHub >

github_iconTop Results From Across the Web

Admin panel customization - Strapi Developer Docs
The administration panel of Strapi can be customized according to your needs, so you can make it reflect your identity.
Read more >
Activeadmin custom filter label is not registering I18n locale
When I remove the translation altogether and reload the page, the error tells me that activeadmin is indeed looking to the wrong translation ......
Read more >
Field Label Translation not working - Drupal Answers
If I enter the English label under "admin/config/regional/translate" nothing is shown. Now for the interesting part:.
Read more >
Translation - React-admin - Marmelab
React-admin components use translation keys for their labels, and rely on the i18nProvider to translate them. For instance:.
Read more >
2576546 - Using the Manage Language Feature to Change ...
I'd like to set custom names in some specific system labels; ... Use the Manage Languages tool from within the Admin Center to...
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