简体   繁体   English

如何自定义批量工具栏的标题<list />反应管理员

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

I would like to custom title of Toolbar in List component of ReactAdmin我想在ReactAdminList组件中自定义Toolbartitle

How to add more text as 2 items selected : Like 2 items selected (SUM: 20000)如何添加更多text作为选择的2 items selected :喜欢2 items selected (SUM: 20000)

在此处输入图像描述

You can override RA default translations like that您可以像这样覆盖 RA 默认翻译

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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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