简体   繁体   中英

How to custom title of bulk toolbar in <List /> react-admin

I would like to custom title of Toolbar in List component of ReactAdmin

How to add more text as 2 items selected : Like 2 items selected (SUM: 20000)

在此处输入图像描述

You can override RA default translations like that

import _merge from 'lodash.merge';
import polyglotI18nProvider from 'ra-i18n-polyglot';
import frenchMessages from 'ra-language-french';
import React from 'react';

const i18nProvider = polyglotI18nProvider(() =>
  _merge(frenchMessages, {
    ra: {
      action: {
        bulk_actions:
          '%{smart_count} sélectionné |||| %{smart_count} sélectionnés',
      },
    },
  })
);

function App(): ReactElement {

  return (
    <Admin i18nProvider={i18nProvider}>
      ...your resources here
    </Admin>
  );
}

export default App;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM