Skip to content

Commit

Permalink
release v2.0.0-beta.13 - rollup 2 for cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Oct 24, 2023
1 parent c393a14 commit d80bc5d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 130 deletions.
19 changes: 12 additions & 7 deletions apps/material-react-table-docs/pages/docs/guides/localization.mdx
Expand Up @@ -3,7 +3,7 @@ import TableOptionsTable from '../../../components/prop-tables/TableOptionsTable
import LocaleExamples from '../../../example-groups/LocaleExamples';

<Head>
<title>Localization/i18n Guide - Material React Table V2 Docs</title>
<title>{'Localization/i18n Guide - Material React Table V2 Docs'}</title>
<meta
name="description"
content="How to customize localization and translations (i18n) in Material React Table"
Expand Down Expand Up @@ -32,15 +32,18 @@ Scroll and find your language below to see an example of how to use it.

<LocaleExamples />

> Note: In some frameworks like Remix, you may need to use a full import path like <br /> > `import { MRT_Localization_ES } from 'material-react-table/locales/es/index.js';` or <br /> > `import { MRT_Localization_ES } from 'material-react-table/locales/es/index.esm.js';` <br />
> to properly import the locale.
### Custom Non-Built-In Translations

If you want to use a language that is not included in the library, you can still easily add your own custom translations to the `localization` prop.

```jsx
<MaterialReactTable
columns={columns}
data={data}
localization={{
const table = useMaterialReactTable({
columns,
data,
localization: {
actions: 'Ações',
and: 'e',
cancel: 'Cancelar',
Expand All @@ -51,8 +54,10 @@ If you want to use a language that is not included in the library, you can still
clearSort: 'Limpar classificações',
clickToCopy: 'Clique para copiar',
// ... and many more - see link below for full list of translation keys
}}
/>
},
});

return <MaterialReactTable table={table} />;
```

For a full list of all available translation keys, see [here](https://github.com/KevinVandy/material-react-table/blob/v2/packages/material-react-table/src/locales/en.ts)
Expand Down
9 changes: 4 additions & 5 deletions apps/test-cra/package.json
Expand Up @@ -8,14 +8,13 @@
"@mui/icons-material": "^5.14.14",
"@mui/material": "^5.14.14",
"@mui/x-date-pickers": "^6.16.3",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"material-react-table": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
152 changes: 34 additions & 118 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d80bc5d

Please sign in to comment.