Arabic translations for React-Admin, the frontend framework for building admin applications on top of REST/GraphQL services.
npm install --save ra-language-arabic
import ArabicMessages from 'ra-language-arabic';
const messages = {
'ar': ArabicMessages,
};
const i18nProvider = locale => messages[locale];
<Admin locale="ar" i18nProvider={i18nProvider}>
...
</Admin>
Material UI is already supprting RTL, so we can add its support to react admin using these 2 steps:
- Change dir property to rtl in your root elements (like body). You can also connect this property to redux.
- Define a theme and set direction to rtl.
import { createMuiTheme } from '@material-ui/core/styles';
const theme = createMuiTheme({
direction: 'rtl',
});
const App = () => (
<Admin theme={theme}>
// ...
</Admin>
);
public/index.html
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root" dir="rtl"></div>
</body>
This translation is licensed under the BSD Licence, and sponsored by Vahid Kheradmand.